-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3855 - Check all files exist in S3 #4207
Conversation
const batchResults = await Promises.each(batches, async (batch) => { | ||
return Promises.each(batch, async ({ uuid: key }) => { | ||
const exists = await FileStorage.fileExists({ key }) | ||
if (!exists) Logger.info(`Missing file in S3: ${key}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I deleted one file from S3 manually to see output from this command
All other files are there (and the file was there before manual deletion ;) )
0077fe28-....-....-....-5809eb1d364c
@minotogna I tried figuring out the best way to test this - but I think in the end, the most important part is that the files exist in S3 - everything else should be reduntant because we didn't change other logic. I couldn't cause other issues in the platform other than a timeout from S3 from spamming requests |
72ef59e
to
dbb1525
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* 3855 - file storage using s3 * 3855 - deprecate old static files * 3855 - migration step: files to s3 * 3855 - responses: add sendFileStream * 3855 - repository/file: don't return file data from postgres/db * 3855 - user profile picture get/put to s3 * 3855 - report get/put to s3 * 3855 - user profile picture get/put to s3 * 3855 - upload file to s3 - tool * 3855 - create and read files from s3 * eol .env.template * FileSize * add default path to uploads * 3855 - fileStorage: fileExists * 3855 - Add checks to avoid duplicate file uploads and ensure idempotent migration * remove double clause * type and migration fix * remove column public.file.file * Migrate all files * 3855 - Check all files exist in S3 (#4207) * 3855 - Add Arrays.chunk * 3855 - Add env var: authCookie * 3855 - Update test * 3855 - Remove authCookie env var * 3855 - Separate upload files (#4215) * rename testAllFilesUploaded * 3855 - Separate file uploading * 3855 - Move s3Files under tools * 3855 - Include public.file in db copy (#4217) * 3855 - minor fixes (#4224) * 3855 - delete file from s3 (#4225) * 3855 - Remove file from public.file (#4226) * 3855 - Remove unused files from S3 (#4231) * 3855 - Add transaction for public.file row removal (#4232) * 3855 - Show file size after uploading (#4233) * 3855 - Add transaction for public.file row removal * 3855 - Show file size after upload --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --------- Co-authored-by: Mino Togna <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
dev note: Avoid run many times back to back -
// Note: Running this script many times may cause runners IP to timeout as protection mechanism