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) {
136
136
137
137
static int lcron_schedule (lua_State * L ) {
138
138
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
+ }
143
146
144
147
size_t i = lcron_findindex (L , ud );
145
148
Original file line number Diff line number Diff line change 83
83
84
84
## cron.entry: schedule ()
85
85
86
- Sets a new schedule mask.
86
+ Sets a new schedule mask and/or restores an unscheduled entry .
87
87
88
88
#### Syntax
89
- ` schedule(mask) `
89
+ ` schedule([ mask] ) `
90
90
91
91
#### Parameters
92
92
- ` 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