-
Notifications
You must be signed in to change notification settings - Fork 431
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
Exception in admin: invalid literal for int() with base 10: '1DAY' #647
Comments
is this regression result of this change #622? |
I think it is. |
I've also created Salamek/cron-descriptor#65 as this might be better to address in PS: Still, django-celery-beat might catch |
Guys, full length day/month names are not valid in CRON expression, you need to "normalize" your "cron" format to valid CRON format before passing it into cron-descriptor. I have looked over (Something like this but better & tested): c = crontab(hour=2, minute=0, day_of_week="monday")
# celery.schedules,crontab converts named days & months to their integer representation, use that instead!
minute, = c.minute
hour, = c.hour
day_of_week, = c.day_of_week
valid_cron = '{} {} {} {} {}'.format( #!FIXME this will totally going to break when used with different CRON parameters provided into crontab()
minute,
hour,
c._orig_day_of_month,
c._orig_month_of_year,
day_of_week
)
print(valid_cron) |
This works fine in Celery, but is non-standard and breaks in current djnago-celery-beat because it causes crash in cron-descriptor. See celery/django-celery-beat#647 and Salamek/cron-descriptor#65
Catch errors from cron-descriptor and display crontab as it is. Apparently there are crontabs which work in Celery, but cron-descriptor fails to format them. Issue #647
* migrate periodic task definition to database via configuration Be aware that we are getting hit by this issue: celery/django-celery-beat#647 Solution is not yet released: celery/django-celery-beat@2798e36 Change-Id: Id72130bdd5fe97be3824f5d9d7a3905af44d3597
* celery/django-celery-beat#647 * Salamek/cron-descriptor#65 * spotted solution at WeblateOrg/weblate@82f1370 Change-Id: I2da6f0f65050d7c7b97609c0505c4647915d52c7
`django-celery-beat` does not support the long version of the `day_of_week=`. However, it works fine using the three-char word of it. It fails when opening the Django Admin on Crontab. See celery/django-celery-beat#647
* Celery: use `django-celery-beat` scheduler This package allows us to store the periodic Celery tasks in the database. Hopefully, it will help us to solve the issue we are having that periodic tasks are triggered when building the AMI and also on deploys. Closes readthedocs/readthedocs-ops#1384 * Celery: use `wed` instead of `wednesday` `django-celery-beat` does not support the long version of the `day_of_week=`. However, it works fine using the three-char word of it. It fails when opening the Django Admin on Crontab. See celery/django-celery-beat#647
Summary:
Include a brief description of the problem here, and fill out the version info below.
Exact steps to reproduce the issue:
0 2 * * monday (m/h/dM/MY/d) UTC
(created via Pythoncrontab(hour=2, minute=0, day_of_week="monday")
)Detailed information
Please include more detailed information here, such as relevant information about your system setup, things you did to try and debug the problem, log messages, etc.
Seems like
monday
becomes1DAY
somewhere on the way.The text was updated successfully, but these errors were encountered: