Skip to content
Snippets Groups Projects
Commit 4a76b581 authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

Merge !1046: lua: clarify event.recurrent() API

parents 915a7595 0bb86feb
1 merge request!1046lua: clarify event.recurrent() API
Pipeline #67740 passed with stage
in 1 minute and 20 seconds
......@@ -94,7 +94,8 @@ static int event_recurrent(lua_State *L)
{
/* Check parameters */
int n = lua_gettop(L);
if (n < 2 || !lua_isnumber(L, 1) || !lua_isfunction(L, 2))
if (n < 2 || !lua_isnumber(L, 1) || lua_tointeger(L, 1) == 0
|| !lua_isfunction(L, 2))
lua_error_p(L, "expected 'recurrent(number interval, function)'");
return event_sched(L, 0, lua_tointeger(L, 1));
......
......@@ -25,7 +25,7 @@ For example, ``5 * hour`` represents five hours, or 5*60*60*100 milliseconds.
:return: event id
Similar to :func:`event.after()`, periodically execute function after ``interval`` passes.
Execute function immediatelly and then periodically after each ``interval``.
Example:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment