aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-03-21 06:48:01 +0300
committerValentin Popov <info@valentineus.link>2018-03-21 06:48:01 +0300
commit2b791958a7a4f21aaa850e9de5484244391d1590 (patch)
tree6ecceebcac43474b411b47800072567f31e92a3d
parent4833a44b519d1f85ef890a0d0e1be2beb92bf63b (diff)
downloadlocal_webhooks-2b791958a7a4f21aaa850e9de5484244391d1590.tar.xz
local_webhooks-2b791958a7a4f21aaa850e9de5484244391d1590.zip
Redesigned cache name
Signed-off-by: Valentin Popov <info@valentineus.link>
-rw-r--r--lib.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib.php b/lib.php
index ce2bb8c..6289fd6 100644
--- a/lib.php
+++ b/lib.php
@@ -72,8 +72,8 @@ function local_webhooks_search_record($eventname, $limitfrom = 0, $limitnum = 0)
}
/* Checks for the presence of a cache */
- $namecache = "${eventname}_${limitfrom}_${limitnum}";
- if (is_array($records = local_webhooks_cache_get($namecache))) {
+ $cachename = crc32($limitnum . $limitfrom . $eventname);
+ if (is_array($records = local_webhooks_cache_get($cachename))) {
return $records;
}
@@ -91,7 +91,7 @@ function local_webhooks_search_record($eventname, $limitfrom = 0, $limitnum = 0)
$rs->close();
/* Saves the result in the cache */
- local_webhooks_cache_set($namecache, $result);
+ local_webhooks_cache_set($cachename, $result);
return $result;
}