diff --git a/api/endpoints/facts_collector.php b/api/endpoints/facts_collector.php index 646cae7..de2bdb1 100644 --- a/api/endpoints/facts_collector.php +++ b/api/endpoints/facts_collector.php @@ -23,7 +23,7 @@ function collect_all(): array { // Prevents expensive external calls when data is still fresh. $fresh = function(string $cat, int $secs): bool { $row = JarvisDB::query( - 'SELECT updated_at FROM kb_facts WHERE fact_category=? ORDER BY updated_at DESC LIMIT 1', + 'SELECT updated_at FROM kb_facts WHERE category=? ORDER BY updated_at DESC LIMIT 1', [$cat] ); if (empty($row[0]['updated_at'])) return false; diff --git a/api/lib/kb_engine.php b/api/lib/kb_engine.php index 6be9ede..ca8efac 100644 --- a/api/lib/kb_engine.php +++ b/api/lib/kb_engine.php @@ -105,7 +105,7 @@ class KBEngine { JarvisDB::execute( 'INSERT INTO kb_facts (category, fact_key, fact_value, host, expires_at) VALUES (?,?,?,?,?) - ON DUPLICATE KEY UPDATE fact_value=VALUES(fact_value), expires_at=VALUES(expires_at)', + ON DUPLICATE KEY UPDATE fact_value=VALUES(fact_value), expires_at=VALUES(expires_at), updated_at=NOW()', [$category, $key, $value, $host, $expires] ); }