gjcarneiro / yacron

A modern Cron replacement that is Docker-friendly
MIT License
449 stars 38 forks source link

@reboot schedule breaks /status endpoint #31

Closed eric239 closed 4 years ago

eric239 commented 4 years ago

When there's a job with @reboot schedule, the /status endpoint fails with the following stack trace:

ERROR:aiohttp.server:Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/yacron/cron.py", line 180, in _web_get_status
    "scheduled_in": crontab.next(default_utc=job.utc),
AttributeError: 'str' object has no attribute 'next'
INFO:aiohttp.access:172.17.0.1 [13/Dec/2019:01:14:01 +0000] "GET /status HTTP/1.1" 500 244 "-" "HTTPie/0.9.9"