Commit 95a5781f authored by Willem Thiart's avatar Willem Thiart
Browse files

raft_periodic can now return RAFT_ERR_SHUTDOWN

parent 9c758317
......@@ -384,7 +384,10 @@ void raft_set_request_timeout(raft_server_t* me, int msec);
/** Process events that are dependent on time passing.
* @param[in] msec_elapsed Time in milliseconds since the last call
* @return 0 on success */
* @return
* 0 on success;
* -1 on failure;
* RAFT_ERR_SHUTDOWN when server should be shutdown */
int raft_periodic(raft_server_t* me, int msec_elapsed);
/** Receive an appendentries message.
......
......@@ -191,8 +191,7 @@ int raft_periodic(raft_server_t* me_, int msec_since_last_period)
}
if (me->last_applied_idx < me->commit_idx)
if (-1 == raft_apply_entry(me_))
return -1;
return raft_apply_entry(me_);
return 0;
}
......
Markdown is supported
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