File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 20
20
"page_title_hierarchy_exclude_home" : true ,
21
21
"custom_var" : [],
22
22
"cache" : 0 ,
23
- "last_cache" : 0 ,
24
23
"translation_set" : 0 ,
25
24
"noscript" : 0 ,
26
25
"codesnippet_before" : " " ,
Original file line number Diff line number Diff line change @@ -110,3 +110,15 @@ function matomo_update_1001() {
110
110
$config->save();
111
111
}
112
112
}
113
+
114
+ /**
115
+ * Change last_cache setting to state.
116
+ */
117
+ function matomo_update_1002() {
118
+ $config = config('matomo.settings');
119
+ $last_cache = $config->get('last_cache');
120
+ $config->clear('last_cache');
121
+ $config->save();
122
+
123
+ state_set('matomo_last_cache', $last_cache);
124
+ }
Original file line number Diff line number Diff line change @@ -468,10 +468,9 @@ function matomo_user_presave($account) {
468
468
function matomo_cron() {
469
469
$config = config('matomo.settings');
470
470
// Regenerate the matomo.js every day.
471
- if (REQUEST_TIME - $config->get('last_cache' ) >= 86400 && $config->get('cache')) {
471
+ if (REQUEST_TIME - state_get('matomo_last_cache', 0 ) >= 86400 && $config->get('cache')) {
472
472
_matomo_cache($config->get('url_http') . 'matomo.js', TRUE);
473
- $config->set('last_cache', REQUEST_TIME);
474
- $config->save();
473
+ state_set('matomo_last_cache', REQUEST_TIME);
475
474
}
476
475
}
477
476
You can’t perform that action at this time.
0 commit comments