Skip to content

Commit

Permalink
Fix Cache Lookup Query
Browse files Browse the repository at this point in the history
No Longer Relying on Time of Database vs Time of App (can have sync/timezone issues).  All times are checked/generated in graphene using Carbon
  • Loading branch information
timcortesi committed Aug 19, 2018
1 parent 9f927ee commit 6d8dc4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/AppInstanceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private function http_endpoint(Endpoint $endpoint, $resource_info, $verb, $all_d
if ($resource_info->cache === true || $resource_info->cache === 'true') {
$cache = ResourceCache::where('app_instance_id', '=', $app_instance_id)
->where('url','=',$url)
->whereRaw('created_at >= (NOW() - INTERVAL 10 MINUTE)')
->where('created_at','>=',Carbon::now()->subMinutes(10)->toDateTimeString())
->first();
if (!is_null($cache)) {
$response = unserialize($cache->content);
Expand Down

0 comments on commit 6d8dc4b

Please sign in to comment.