Skip to content
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

ACAS-764: Clean up cmpdreg exported search results > 24 hours old #1152

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

brianbolt
Copy link
Contributor

@brianbolt brianbolt commented Apr 16, 2024

Description

  • Delete exported search results that are > 24 hours since last modified after the export searchResults route is called

Related Issue

ACAS-764

How Has This Been Tested?

  1. Basic
    Exported some search results and then ran: touch -d "25 hours ago" privateUploads/exportedSearchResults/*.sdf
    Verified the files were cleaned up

  2. Folder
    Added a folder to exportedSearchResults and verified this did not produce and error and was skipped

  3. Added a purposeful error inside the cleanUpExportedSearchResults function and verified that the exportSearchResults function continue to work (just to make sure this doesn't break export if it happens to error for some reason.

  4. Deployed this to a stage server with a lot of old exported search results and verified it cleaned up old files when I exported search results.

@@ -927,6 +927,7 @@ exports.exportSearchResults = (req, resp) ->
serverUtilityFunctions.ensureExists exportedSearchResults, 0o0744, (err) ->
if err?
console.log "Can't find or create exportedSearchResults folder: " + exportedSearchResults
console.error err
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outside pr scope: I wanted this to print the actual error. I initial had a weird local setup that was producing and an error and I added this line to debug the issue.

@brianbolt brianbolt changed the title ACAS-764 ACAS-764: Clean up cmpdreg exported search results > 24 hours old Apr 16, 2024
Copy link
Collaborator

@bffrost bffrost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. TIL we can run more code after resp.end, but makes sense since it's all async and not a true "return"

@brianbolt brianbolt merged commit 4dcd0ad into release/2024.1.x Apr 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants