fix: update apps cache by reading from primary db

This commit is contained in:
jelveh 2024-11-08 10:56:00 -08:00
parent 164d5ef167
commit e8f67da9a3

View File

@ -240,11 +240,11 @@ async function refresh_apps_cache(options, override){
let app;
if(options.name)
app = await db.read('SELECT * FROM apps WHERE name = ?', [options.name]);
app = await db.pread('SELECT * FROM apps WHERE name = ?', [options.name]);
else if(options.uid)
app = await db.read('SELECT * FROM apps WHERE uid = ?', [options.uid]);
app = await db.pread('SELECT * FROM apps WHERE uid = ?', [options.uid]);
else if(options.id)
app = await db.read('SELECT * FROM apps WHERE id = ?', [options.id]);
app = await db.pread('SELECT * FROM apps WHERE id = ?', [options.id]);
else {
log.error('invalid options to refresh_apps_cache');
throw new Error('Invalid options provided');