Skip to content

Commit

Permalink
Fix notice
Browse files Browse the repository at this point in the history
  • Loading branch information
jaapjansma authored Feb 3, 2022
1 parent 3425c37 commit 6b71f32
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMRF/PersistenceLayer/SQLPersistingCallFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ public function __construct(mysqli $sql_connection, $table_name, callable $const
public function createOrFetch($connector_id, $core, $entity, $action, $parameters, $options, $callback) {
if(!empty($options['cache'])) {
$today = new \DateTime();
$today = $today->format('Y-m-d H:i:s');
$hash = AbstractCall::getHashFromParams($entity,$action,$parameters,$options);
$stmt=$this->connection->prepare("select * from {$this->table_name} where request_hash = ? and connector_id = ? and cached_until > ? limit 1");
$stmt->bind_param("sss",$hash,$connector_id, $today->format('Y-m-d H:i:s'));
$stmt->bind_param("sss",$hash,$connector_id, $today);
$stmt->execute();

$result=$stmt->get_result();
Expand Down

0 comments on commit 6b71f32

Please sign in to comment.