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