Comments (3)
Quick update regarding the above. Looks like that if you configure the Scheduled Jobs with custom interval and add the crontab to run at specific time daily, everything works as expected. Meaning scheduling the above job but with the following:
'crontab': '0 10 * * *',
'interval': 'custom',
the Job is scheduled at 10:00am Berlin's time, respecting the time zone as shown below:
'last_run_at': datetime.datetime(2024, 4, 22, 8, 0, 0, 604761, tzinfo=<UTC>),
'start_time': datetime.datetime(2024, 4, 19, 10, 0, tzinfo=<UTC>),
I hope this helps to identify the issue. Keep in mind, still the total run count is double the actual.
from nautobot.
See also #3349
from nautobot.
Looks like the issue may be that our ScheduledJob.to_cron()
and ScheduledJob.get_crontab()
methods are not properly timezone aware (as alluded to originally in #3349 (comment)). Likely approach to fixing this:
- Add a
TimezoneField
to theScheduledJob
model and set it based onTIME_ZONE
when creating the ScheduledJob. (This appears necessary because with our default ofUSE_TZ=True
,DateTimeField
always converts a provideddatetime
to UTC before storing to the database, losing important context like DST). to_cron()
for DAILY and WEEKLY ScheduledJobs needs to retrieve the timezone and pass it through toget_crontab
as an additional parameterget_crontab()
needs to either pass the timezone'snowfun
when creating aschedules.crontab()
OR switch to creating a celery-beatTzAwareCrontab
instead.
Will need to test with:
- TIME_ZONE = utc
- TIME_ZONE = Americas/New York (with/without DST in effect)
- changing TIME_ZONE after creating a ScheduledJob and making sure the original timezone of the job remains in effect.
from nautobot.
Related Issues (20)
- UI Components: Implement standard details tabs
- UI Components: Buttons
- Spike: Event system design HOT 1
- Virtual Device Contexts
- Queries on negation of device status requires UUIDs
- Missing DynamicGroup content (refresh dynamic group message) on DeviceDetailView and SoftwareDetailView
- Job Queue changes backwards compatible
- Prefix utilization calculation error
- Edit and Delete Button move to middle of each row after adding Custom Field HOT 1
- Search and replace using regex substitution HOT 2
- Possible error in openAPI specification
- Stats Panel Rendered Incorrectly
- Support Images on Module Types
- Health check of S3 fails HOT 1
- Log Cleanup job handling ProtectedErrors HOT 1
- support idempotent / upsert objects via the API HOT 1
- Network Prefix does not display the correct utilization for IP Addresses, and may present in-use IP Addresses HOT 1
- Bookmark/favorite pages and list those at the top of the sidebar
- Use the tree to search for a location in add form HOT 1
- Allow set-based Dynamic Group to include static-assignment-based Dynamic Groups HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nautobot.