nce a writable stream is closed, it cannot accept anymore data (see the documentation): this is why on the first execution your code will work, and on the second you’ll have theerror.
Just create a new gunzip stream for each request:
write after enderror.http.get(url, function(req) {
var gunzip = zlib.createGzip();
req.pipe(gunzip);
gunzip.on('data', function (data) {
decoder.decode(data);
});
gunzip.on('end', function() {
decoder.result();
});
});
Câu trả lời ngắn gọn là: CÓ . Trên thực tế, đây chính là cách chuẩn nhất để tạo các bài viết chưa hiển thị công khai (bao gồm Bản nháp, B...
Không có nhận xét nào:
Đăng nhận xét