Thanks to visit codestin.com
Credit goes to github.com

Skip to content

create cron-style library or wrapper for workspace autostart / autostop #817

Closed
@johnstcn

Description

@johnstcn

As a user, I want to easily be able to specify a schedule for automatically starting and stopping a workspace.
The most convenient and familiar format for this is the crontab-style expression <minute> <hour> <day of month> <month> <day of week>. However, this syntax does not inlcude timezones as cronjobs are executed according to the timezone of the machine that is running them.

A simple solution is to simply append the timezone name to the cron expression e.g. 12 34 25 12 * Asia/Kolkata will specify 12:34 PM in India time (GMT+0530) on December 25th. Going to call this crontabtz for the moment.

Write a thin wrapper library that leverages existing libraries (e.g. https://github.com/robfig/cron/blob/v3/spec.go) to serialise and deserialize crontabtz expressions, supporting the following actions:

  • Parse a crontabtz expression from a string
  • Serialize a crontabtz expression to a string
  • Get the next scheduled time from the expression from a specific time

Metadata

Metadata

Assignees

Labels

apiArea: HTTP API

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions