Use an ISODate for deleted file names

This commit is contained in:
Simon Detheridge 2020-03-16 16:09:56 +00:00
parent 9d32d4ec16
commit cb4bdd99f4
2 changed files with 2 additions and 2 deletions

View file

@ -184,7 +184,7 @@ async function deleteFile(bucketName, key) {
await file.copy(
storage
.bucket(`${bucketName}${settings.filestore.gcs.deletedBucketSuffix}`)
.file(`${key}-${new Date()}`)
.file(`${key}-${new Date().toISOString()}`)
)
}
if (settings.filestore.gcs.unlockBeforeDelete) {

View file

@ -453,7 +453,7 @@ describe('Filestore', function() {
await TestHelper.expectPersistorToHaveFile(
app.persistor,
`${Settings.filestore.stores.user_files}-deleted`,
`${projectId}/${fileId}-${date}`,
`${projectId}/${fileId}-${date.toISOString()}`,
content
)
})