update to 2.2.5 version

add saveToJson and loadFromJson function for DataProvider.php
fix @OnSave annotation not working
adjust swoole timer tick
add hasKey() for WorkerCache.php
This commit is contained in:
jerry
2021-02-15 15:15:26 +08:00
parent f137f044d0
commit f677b0e132
8 changed files with 92 additions and 6 deletions

View File

@@ -267,10 +267,14 @@ function zm_timer_after($ms, callable $callable) {
}
function zm_timer_tick($ms, callable $callable) {
go(function () use ($ms, $callable) {
Console::debug("Adding extra timer tick of " . $ms . " ms");
Swoole\Timer::tick($ms, $callable);
});
if (zm_cid() === -1) {
return go(function () use ($ms, $callable) {
Console::debug("Adding extra timer tick of " . $ms . " ms");
Swoole\Timer::tick($ms, $callable);
});
} else {
return Swoole\Timer::tick($ms, $callable);
}
}
function zm_data_hash($v) {