Skip to content

Commit

Permalink
Fixed the cache bug
Browse files Browse the repository at this point in the history
  • Loading branch information
waiyanheincyberduck committed Jul 2, 2019
1 parent 99e9f76 commit e0a2cd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Controller/PardotController.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private function getDynamicContent()
]));
}
$contentList = $contents->Sort('Title')->map();
$cache->set(self::$DYNAMIC_CONTENTS_CACHE_KEY, serialize($formList), static::getCacheDuration());
$cache->set(self::$DYNAMIC_CONTENTS_CACHE_KEY, serialize($contentList), static::getCacheDuration());

return $contentList;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Provider/PardotShortCodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ public static function PardotForm($arguments, $content, $parser, $shortcode, $ex
$form = unserialize($cache->get(self::formCacheKey($arguments['id'])));
}


if (! $form) {
$form = PardotApiService::getApi()->form()->read($arguments['id']);
$cache->set(self::formCacheKey($arguments['id']), serialize($content), static::getCacheDuration());
$cache->set(self::formCacheKey($arguments['id']), serialize($form), static::getCacheDuration());
}

$code = $form->embedCode;
Expand Down

0 comments on commit e0a2cd0

Please sign in to comment.