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 @@ -136,10 +136,13 @@ static size_t lcron_findindex(lua_State *L, cronent_ud_t *ud) {
136136
137137static int lcron_schedule (lua_State * L ) {
138138 cronent_ud_t * ud = luaL_checkudata (L , 1 , "cron.entry" );
139- char * strdesc = (char * )luaL_checkstring (L , 2 );
140- struct cronent_desc desc ;
141- lcron_parsedesc (L , strdesc , & desc );
142- ud -> desc = desc ;
139+ char * strdesc = (char * )luaL_optstring (L , 2 , NULL );
140+
141+ if (strdesc != NULL ) {
142+ struct cronent_desc desc ;
143+ lcron_parsedesc (L , strdesc , & desc );
144+ ud -> desc = desc ;
145+ }
143146
144147 size_t i = lcron_findindex (L , ud );
145148
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