Skip to content

"Show cronjobs" displays error schedule #16

@suevii

Description

@suevii

Hi,

Environment

Jupyterlab version: 3.0.6

Description

I found this issue when I click the "Show cronjobs" button.
image

Reproduce steps

The issue is randomly occured, to reproduce it:

  1. add several jobs
  2. delete some of them

Workaround

I found it was caused by the missing of blank line between the job and the previous variables in the system crontab file:
截屏2021-12-29 上午10 18 30

If I try to add a blank line, the issue is fixed.
截屏2021-12-29 上午10 28 07

I think there may be some bug when calling the /delete api (which delete some extra blank lines) or the regex pattern matching the schedule (but when I test the pattern outside the jupyterlab, it seems correct).
My current solution is to change the regex pattern matching the schedule in the get /list API:
schedule_match = re.search(r"(((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7}", str(job))
schedule = schedule_match.group(0)
instead of above code:
schedule = str(job.slices)

With this fix the issue is gone, but I'm not sure it causes other issue.
Please comment if anything wrong, thank you.😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions