-
Notifications
You must be signed in to change notification settings - Fork 17
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
BC-7561 - separate job for failed batch deletion requests #5448
base: main
Are you sure you want to change the base?
Conversation
this commit changes failed deletion and counted pending requests to also be older than configured threshold
add new config var for when pending or failed should be no longer processed
979f793
to
ef53fad
Compare
a6bef9f
to
ee088b5
Compare
ceaa2f4
to
b9b6c83
Compare
b9b6c83
to
8b8e624
Compare
165f606
to
51ea68e
Compare
apps/server/src/modules/deletion-console/deletion-client/deletion.client.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/deletion/api/controller/api-test/deletion-request-create.api.spec.ts
Outdated
Show resolved
Hide resolved
], | ||
}, | ||
], | ||
const newerThan = new Date(Date.now() - 15 * 60 * 1000); // 15 minutes ago |
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.
setting variable instead of comment? (same for below)
@@ -851,6 +851,8 @@ describe('UserService', () => { | |||
userRepo.findByIdOrNull.mockResolvedValueOnce(user); | |||
userRepo.deleteUser.mockResolvedValue(1); | |||
|
|||
config.get.mockReturnValue(true); |
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.
maybe specify which config get should be mocked instead of a general mock return?
apps/server/src/modules/deletion-console/builder/trigger-deletion-execution-options.builder.ts
Outdated
Show resolved
Hide resolved
@@ -17,5 +16,5 @@ export class DeletionRequestBodyProps { | |||
required: true, | |||
nullable: false, | |||
}) | |||
deleteInMinutes?: number = MINUTES_OF_30_DAYS; | |||
deleteAfterMinutes?: number; |
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.
it is unconventional to use minutes instead of seconds as base time unit
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.
true, but also makes overwrites if needed, harder to calculate. Had the same thought to stick to milliseconds, but is not practical either
I just kept the it, just rename the var to better describe what it actually does and relate to db field
...rver/src/modules/deletion-console/builder/trigger-deletion-execution-options.builder.spec.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/deletion/repo/scope/deletion-request-scope.ts
Outdated
Show resolved
Hide resolved
2b16c4f
to
c0df280
Compare
c0df280
to
e216fc9
Compare
Quality Gate passedIssues Measures |
@@ -26,9 +26,9 @@ export class DeletionClient { | |||
} | |||
} | |||
|
|||
public async executeDeletions(limit?: number): Promise<void> { | |||
public async executeDeletions(limit?: number, runFailed?: boolean): Promise<void> { |
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.
Would it make sense to use an options object type instead of sereate parameters? Would better show the independence of limit
and runFailed
IMHO. (maybe also a matter of taste)
avoid loading node by checking how many requests are already currently in progress
Description
Links to Tickets or other pull requests
BC-7561
hpi-schul-cloud/dof_app_deploy#1095
Approval for review
generate-client:server
was executed in vue frontend and changes were tested and put in a PR with the same branch name.