diff options
author | Christian Schneider | 2019-05-03 16:54:19 +0200 |
---|---|---|
committer | Christian Schneider | 2019-05-03 16:54:19 +0200 |
commit | a721c5b74898df1de9757f455afd3fd7bf00732a (patch) | |
tree | 003396ea9893157fea527e382dcfefab981c1e73 | |
parent | 19fa47e678cef0cb3878e9378d1e178651035ae4 (diff) | |
download | itools-a721c5b74898df1de9757f455afd3fd7bf00732a.tar.gz itools-a721c5b74898df1de9757f455afd3fd7bf00732a.tar.bz2 itools-a721c5b74898df1de9757f455afd3fd7bf00732a.zip |
Forgot to add additional data to checksum, previously it only changed cache key
-rw-r--r-- | itjs.class | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -201,12 +201,13 @@ static function checksum($fnlist, $p = array()) foreach (is_array($fnlist) ? $fnlist : itjs::filenames($fnlist) as $filename) $filenames[] = !file_exists($filename) && file_exists($t = it::replace(array('^/www/[^/]*' => "/www/lib.search.ch"), $filename)) ? $t : $filename; - $key = "itjs_" . md5(join("", it::map('"$v" . @filemtime("$v")', $filenames)) . '|' . json_encode($p['additional_data'])); + $additional = json_encode($p['additional_data']); + $key = "itjs_" . md5(join("", it::map('"$v" . @filemtime("$v")', $filenames)) . $additional); if ($filenames && $p['short_expire'] && (time() - max(@array_map('filemtime', $filenames)) < 60)) return "-"; # trigger short expire, our file may not yet be up to date on other slaves else if ($filenames) - return it_cache::get($key) ?: it_cache::put($key, substr(md5("X" . self::filecontents($filenames)), 0, 10), array('ttl' => 60)); + return it_cache::get($key) ?: it_cache::put($key, substr(md5("X" . self::filecontents($filenames) . $additional), 0, 10), array('ttl' => 60)); } /** |