Skip to content
This repository has been archived by the owner on Aug 21, 2019. It is now read-only.

Commit

Permalink
fixed cache
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Meilick <b@bnomei.com>
  • Loading branch information
bnomei committed Jun 5, 2019
1 parent 5b91d0f commit 6a1049b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions kirby-mailjet-routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
}

if ($file == 'contactslists.json') {
if (!$cl || f::modified($cacheFile) + c::get('plugin.mailjet.json.cache', 60*5) < time()) {
if (!$cl || f::modified($cacheFile) + c::get('plugin.mailjet.json.cache', 60 * 5) < time()) {
$cls = KirbyMailjet::contactslists();
if (count($cls) > 0) {
f::write($cacheFile, json_encode($cl));
f::write($cacheFile, json_encode($cls));
$cl = $cls;
}
}
Expand All @@ -58,10 +58,10 @@
$code = 200;
}
} elseif ($file == 'segments.json') {
if (!$cl || f::modified($cacheFile) + c::get('plugin.mailjet.json.cache', 60*5) < time()) {
if (!$cl || f::modified($cacheFile) + c::get('plugin.mailjet.json.cache', 60 * 5) < time()) {
$cls = KirbyMailjet::segments();
if (count($cls) > 0) {
f::write($cacheFile, json_encode($cl));
f::write($cacheFile, json_encode($cls));
$cl = $cls;
}
}
Expand All @@ -70,10 +70,10 @@
$code = 200;
}
} elseif ($file == 'senders.json') {
if (!$cl || f::modified($cacheFile) + c::get('plugin.mailjet.json.cache', 60*5) < time()) {
if (!$cl || f::modified($cacheFile) + c::get('plugin.mailjet.json.cache', 60 * 5) < time()) {
$cls = KirbyMailjet::senders();
if (count($cls) > 0) {
f::write($cacheFile, json_encode($cl));
f::write($cacheFile, json_encode($cls));
$cl = $cls;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kirby-mailjet",
"description": "Kirby Mailjet makes sending emails with Mailjet simple.",
"version": "0.9.0",
"version": "0.9.1",
"author": "Bruno Meilick",
"type": "kirby-plugin",
"license": "Commercial"
Expand Down

0 comments on commit 6a1049b

Please sign in to comment.