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

Add cleaner for orphaned files #1406

Merged
merged 1 commit into from
Nov 29, 2023
Merged

Add cleaner for orphaned files #1406

merged 1 commit into from
Nov 29, 2023

Conversation

radito3
Copy link
Contributor

@radito3 radito3 commented Nov 23, 2023

Delete files that have no started operation within the last hour

LMCROSSITXSADEPLOY-2714

LOGGER.debug(MessageFormat.format(Messages.GETTING_OPERATIONS_STARTED_AFTER_0, oneHourAgo));
var operations = operationService.createQuery()
.startedAfter(oneHourAgo)
.withMtaIdsIn(List.copyOf(fileIds))
Copy link
Contributor

Choose a reason for hiding this comment

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

File ID is the same as the MTA ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, this was a leftover from when the code assumed the operations had a relation to the files.
Removed

LOGGER.debug(Messages.NO_ORPHANED_FILES_TO_DELETE);
return;
}
LOGGER.debug(MessageFormat.format(Messages.DELETING_ORPHANED_FILES_0, fileIdsToFiles.keySet()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Log how many files are deleted

Delete files that have no started operation within the last hour

LMCROSSITXSADEPLOY-2714
Copy link
Contributor

@IvanBorislavovDimitrov IvanBorislavovDimitrov left a comment

Choose a reason for hiding this comment

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

LGTM just log how many files are deleted

@radito3 radito3 merged commit dce2536 into cloudfoundry:master Nov 29, 2023
3 of 4 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