File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -135,10 +135,13 @@ static size_t lcron_findindex(lua_State *L, cronent_ud_t *ud) {
135135
136136static int lcron_schedule (lua_State * L ) {
137137 cronent_ud_t * ud = luaL_checkudata (L , 1 , "cron.entry" );
138- char * strdesc = (char * )luaL_checkstring (L , 2 );
139- struct cronent_desc desc ;
140- lcron_parsedesc (L , strdesc , & desc );
141- ud -> desc = desc ;
138+ char * strdesc = (char * )luaL_optstring (L , 2 , NULL );
139+
140+ if (strdesc != NULL ) {
141+ struct cronent_desc desc ;
142+ lcron_parsedesc (L , strdesc , & desc );
143+ ud -> desc = desc ;
144+ }
142145
143146 size_t i = lcron_findindex (L , ud );
144147
Original file line number Diff line number Diff line change 8383
8484## cron.entry: schedule ()
8585
86- Sets a new schedule mask.
86+ Sets a new schedule mask and/or restores an unscheduled entry .
8787
8888#### Syntax
89- ` schedule(mask) `
89+ ` schedule([ mask] ) `
9090
9191#### Parameters
9292- ` mask ` - [ crontab] ( https://en.wikipedia.org/wiki/Cron#Overview ) -like string mask for schedule
You can’t perform that action at this time.
0 commit comments