Reputation: 3
Here is the code to delete file but dont know how to delete it after certain time as there is no way in documentation.
// Delete content file
var fileToBeDeleted = null
fileToBeDeleted = bucket.file(baseContentUrl)
await fileToBeDeleted.delete()
Upvotes: 0
Views: 152
Reputation: 82
var fileToBeDeleted = null;
var numberofMiliseconds = 60 * 1000;
fileToBeDeleted = bucket.file(baseContentUrl);
setTimeout(async () => {
//you can do any operation you want to do after 60 section this line will execute.
await fileToBeDeleted.delete();
}, numberofMiliseconds);
Upvotes: 0
Reputation: 2133
Something like this should work:
var fileToBeDeleted = bucket.file(baseContentUrl);
setTimeout(async () => {
await fileToBeDeleted.delete()
// Do something after deleting.
}, 60 * 1000);
Hope it helps.
Upvotes: 0