GoogleCloudPlatform/nodejs-getting-started

memory leak

jaman99 opened this issue · 1 comments

var myvideo=req.files.myvideo[0].originalname;

var ext = path.extname(''+myvideo+'');
const gcsname =Date.now()+ext;
console.log('Hello wold ');
console.log(gcsname);

	  const file = bucket.file(gcsname);

	  const stream = file.createWriteStream({
	    metadata: {
	      contentType: req.files.myvideo[0].mimetype
	    },
	    resumable: false
	  });

	  stream.on('error', (err) => {
	    req.files.myvideo[0].cloudStorageError = err;
	    req.videocheck=false;
	    console.log('Error function hit.....');
	      mystreamendfun();
	    next(err);
	  });

	  stream.on('finish', () => {
	    req.files.myvideo.cloudStorageObjectimg = gcsname;
	    file.makePublic().then(() => {
	      req.files.myvideo[0].cloudStoragePublicUrlimg =getPublicUrl(gcsname);
	      req.videocheck=true;
         console.log('Finish function hit.....');
	      mystreamendfun();

	      next();
	    });
	  });



 stream.end(req.files.myvideo[0].buffer);

Hi @jaman99 , thank you for the detailed bug report. Unfortunately, this issue tracker has limited visibility and scope - basically, it's just for reporting issues with the samples contained here and is only watched by the folks who work on these samples.

We are happy to help you move this bug to venues where it'll get the attention of the appropriate product teams.

I'm going to close this issue because the folks who own this repo have no actionable way to resolve it directly, but please let us know if there's anything we can do to help!