Skip to content

Change scheduler to apscheduler #1024

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

tjeerddie
Copy link
Contributor

  • update cli commands.
  • update unit tests.

Related: #909

@tjeerddie tjeerddie force-pushed the 909-change-to-apscheduler branch from cd7f1de to ec2aa44 Compare August 8, 2025 13:01
Copy link

codspeed-hq bot commented Aug 8, 2025

CodSpeed Performance Report

Merging #1024 will not alter performance

Comparing 909-change-to-apscheduler (a2fc3f0) with main (6182932)

🎉 Hooray! pytest-codspeed just leveled up to 4.0.0!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 13 untouched benchmarks

@tjeerddie tjeerddie force-pushed the 909-change-to-apscheduler branch 4 times, most recently from c2b5da8 to 09e0590 Compare August 12, 2025 07:27
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 76.21951% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.09%. Comparing base (6182932) to head (a2fc3f0).

Files with missing lines Patch % Lines
orchestrator/schedules/scheduling.py 26.08% 17 Missing ⚠️
orchestrator/schedules/scheduler.py 81.08% 11 Missing and 3 partials ⚠️
orchestrator/cli/scheduler.py 76.66% 7 Missing ⚠️
orchestrator/graphql/resolvers/scheduled_tasks.py 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1024      +/-   ##
==========================================
+ Coverage   84.93%   85.09%   +0.16%     
==========================================
  Files         214      217       +3     
  Lines       10408    10481      +73     
  Branches     1020     1003      -17     
==========================================
+ Hits         8840     8919      +79     
- Misses       1295     1308      +13     
+ Partials      273      254      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tjeerddie tjeerddie force-pushed the 909-change-to-apscheduler branch 6 times, most recently from b406470 to 5074546 Compare August 12, 2025 10:15
@tjeerddie tjeerddie marked this pull request as draft August 12, 2025 10:20
@tjeerddie tjeerddie force-pushed the 909-change-to-apscheduler branch 5 times, most recently from de944b7 to af4b6a8 Compare August 12, 2025 12:20
- update cli commands.
- update unit tests.
- rename scheduled jobs to scheduled tasks
@tjeerddie tjeerddie force-pushed the 909-change-to-apscheduler branch from af4b6a8 to ad0f3bc Compare August 12, 2025 12:31
@tjeerddie tjeerddie marked this pull request as ready for review August 12, 2025 12:53
- update deprecation of `db.wrapped_database.scoped_session.close_all()` to `close_all_sessions()`.
@tjeerddie tjeerddie force-pushed the 909-change-to-apscheduler branch from ad0f3bc to a2fc3f0 Compare August 12, 2025 12:57
if isinstance(value, (int, float)):
return -value
if isinstance(value, str):
return "".join(chr(255 - ord(c)) for c in value)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is limited to ascii chars, anything beyond that raises a ValueError. Can address this by keeping the unicode points as a tuple

return tuple(-ord(c) for c in value)

return -value
if isinstance(value, str):
return "".join(chr(255 - ord(c)) for c in value)
return value
Copy link
Contributor

Choose a reason for hiding this comment

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

Think datetime should be covered here?

Comment on lines +128 to +131
scheduler.start(paused=True)
scheduled_tasks = scheduler.get_jobs()
scheduler.shutdown(wait=False)
jobstores["default"].engine.dispose()
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to have a utility function for this, few repetitions here and in cli module

mock_job.args = ()
mock_job.kwargs = {}

# mock_scheduler.start = mock.MagicMock()
Copy link
Contributor

Choose a reason for hiding this comment

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

few commented lines in file can be removed

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