Redesigned cache name
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
parent
4833a44b51
commit
2b791958a7
6
lib.php
6
lib.php
@ -72,8 +72,8 @@ function local_webhooks_search_record($eventname, $limitfrom = 0, $limitnum = 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Checks for the presence of a cache */
|
/* Checks for the presence of a cache */
|
||||||
$namecache = "${eventname}_${limitfrom}_${limitnum}";
|
$cachename = crc32($limitnum . $limitfrom . $eventname);
|
||||||
if (is_array($records = local_webhooks_cache_get($namecache))) {
|
if (is_array($records = local_webhooks_cache_get($cachename))) {
|
||||||
return $records;
|
return $records;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ function local_webhooks_search_record($eventname, $limitfrom = 0, $limitnum = 0)
|
|||||||
$rs->close();
|
$rs->close();
|
||||||
|
|
||||||
/* Saves the result in the cache */
|
/* Saves the result in the cache */
|
||||||
local_webhooks_cache_set($namecache, $result);
|
local_webhooks_cache_set($cachename, $result);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user