Skip to content

Commit

Permalink
All $cache->set calls should have $ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Jan 12, 2025
1 parent 77a2c1c commit 085ebbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
if(fetchDatabaseConfig('last_usage_report', $value)) {
$should_report = time() > (int)$value + $report_time;
if($cache->enabled()) {
$cache->set('last_usage_report', $value);
$cache->set('last_usage_report', $value, 60 * 60);
}
}
else {
Expand All @@ -148,7 +148,7 @@

updateDatabaseConfig('last_usage_report', time());
if($cache->enabled()) {
$cache->set('last_usage_report', time());
$cache->set('last_usage_report', time(), 60 * 60);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions system/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@

// cache config
if($cache->enabled()) {
$cache->set('config_lua', serialize($config['lua']), 120);
$cache->set('server_path', $config['server_path']);
$cache->set('config_lua', serialize($config['lua']), 2 * 60);
$cache->set('server_path', $config['server_path'], 10 * 60);
}
}
unset($tmp);
Expand Down
2 changes: 1 addition & 1 deletion system/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
unset($file);

if ($cache->enabled()) {
$cache->set('template_ini_' . $template_name, serialize($template_ini));
$cache->set('template_ini_' . $template_name, serialize($template_ini), 10 * 60);
}
}
}
Expand Down

0 comments on commit 085ebbc

Please sign in to comment.