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 17, 2025
1 parent 7c3ebf7 commit 37ba9c7
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 @@ -221,7 +221,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 @@ -236,7 +236,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 @@ -74,8 +74,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 @@ -83,7 +83,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 37ba9c7

Please sign in to comment.