Periodic task with timezone
Project description
Periodic task with timezone
from periodtask import Task, Period, parse_cron, send_mail
def _send_mail(subject, message, html_message=None):
return send_mail(
subject, message,
from_email='from@my.service',
recipient_list=['admins@my.service'],
html_message=html_message
)
task = Task(
name='test',
command=('/periodtask/test_script.py',),
periods=[
Period(
timezone='Europe/Budapest',
minutes=list(range(0, 60)),
seconds=list(range(0, 60, 5)),
),
parse_cron('* * * * * Europe/Budapest * */5')
],
run_on_start=True,
mail_failure=True,
mail_success=True,
mail_skipped=True,
wait_timeout=5,
stop_signal=signal.SIGINT,
send_mail_func=_send_mail,
policy=SKIP
)
task.start()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
periodtask-0.3.1.tar.gz
(7.6 kB
view details)
File details
Details for the file periodtask-0.3.1.tar.gz
.
File metadata
- Download URL: periodtask-0.3.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c33466073577bf136ce7545bab43ade5ad7c12ec8ff8f0e67142e58e06e3106 |
|
MD5 | 4d36edeed4e37ade83d8e64aac01716b |
|
BLAKE2b-256 | 2be694be558d4c0722b547143cc9170f3d3634a3d08589e2b18bd194d05d4b48 |