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

[SDESK-7445] - Planning: Migrate planning:purge_expired_locks command to async #2142

Merged
merged 50 commits into from
Dec 5, 2024

Conversation

BrianMwangi21
Copy link

@BrianMwangi21 BrianMwangi21 commented Dec 2, 2024

Purpose

This PR updates the planning:purge_expired_locks command to async by:

  • Updating command to use new format
  • Making use of the new async methods from events, planning and assignments to get list of expired locks and remove them.
  • Updated tests

Solves SDESK-7445

Note

This PR depends on #2131 so it is quite big but will become concise when the PR is merged.

eos87 and others added 30 commits November 20, 2024 17:16
SDESK-7441
Fix behave tests partially

SDESK-7441

Allow behave tests to run async code

SDESK-7441

Fix pytests and use python 3.10 only

Disable some actions and add verbose mode 999

Remove python 3.8

Point sd core to fix branch

Revert "Fix linter issues"

This reverts commit 152cfb5.

Revert changes to ci-install

SDESK-7441

Fix first batch of tests

Reapply "Fix linter issues"

This reverts commit e5ac69a.

Fix second batch of tests

SDESK-7441

Fix tests batch 3

Fix tests batch 4

SDESK-7441

Fix superdesk-core dependency

Fix linter issues

SDESK-7441
logger.info(f"Purging expired locks for {resource}")
resource_service = SERVICE_MAPPING[resource]
try:
autosave_service = get_resource_service("event_autosave" if resource == "events" else f"{resource}_autosave")
Copy link
Author

Choose a reason for hiding this comment

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

@MarkLark86 we are making use of autosave services here. They are yet to be converted to async. Do they remain as is and just add a TODO to get back to them when finished ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That sounds fine

@BrianMwangi21 BrianMwangi21 changed the title [SDESK-7443] - Planning: Migrate planning:purge_expired_locks command to async [SDESK-7445] - Planning: Migrate planning:purge_expired_locks command to async Dec 2, 2024
Copy link
Collaborator

@MarkLark86 MarkLark86 left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple small suggestions

server/planning/commands/purge_expired_locks.py Outdated Show resolved Hide resolved
server/planning/commands/purge_expired_locks.py Outdated Show resolved Hide resolved
server/planning/commands/purge_expired_locks_test.py Outdated Show resolved Hide resolved
server/planning/commands/purge_expired_locks_test.py Outdated Show resolved Hide resolved
server/planning/commands/purge_expired_locks_test.py Outdated Show resolved Hide resolved
@BrianMwangi21 BrianMwangi21 merged commit 9a1fe66 into superdesk:async Dec 5, 2024
5 of 10 checks passed
@eos87 eos87 added this to the 3.0 milestone Dec 10, 2024
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.

3 participants