mirror of
https://github.com/HeyPuter/puter.git
synced 2025-12-21 12:59:52 -06:00
fix: bad caching query crashing our db (#2172)
* logs: add errors to cache log * logs: add errors to cache log * fix: bad caching query crashing our db
This commit is contained in:
@@ -63,39 +63,28 @@ class AppInformationService extends BaseService {
|
||||
}
|
||||
|
||||
async '__on_boot.consolidation' () {
|
||||
(async () => {
|
||||
try {
|
||||
ENABLE_REFRESH_APP_CACHE && await this._refresh_app_cache();
|
||||
await this._refresh_app_stats();
|
||||
await this._refresh_recent_cache();
|
||||
} catch (e) {
|
||||
console.error('Some app cache portion failed to populate:', e);
|
||||
}
|
||||
ENABLE_REFRESH_APP_CACHE && setInterval(async () => {
|
||||
try {
|
||||
await this._refresh_app_cache();
|
||||
} catch (e) {
|
||||
console.error('App cache failed to update:', e);
|
||||
}
|
||||
}, 30 * 1000);
|
||||
setInterval(async () => {
|
||||
try {
|
||||
ENABLE_REFRESH_APP_CACHE && await this._refresh_app_cache();
|
||||
await this._refresh_app_stats();
|
||||
await this._refresh_app_stat_referrals();
|
||||
await this._refresh_recent_cache();
|
||||
} catch (e) {
|
||||
console.error('Some app cache portion failed to populate:', e);
|
||||
console.error('App stats cache failed to update:', e);
|
||||
}
|
||||
ENABLE_REFRESH_APP_CACHE && setInterval(async () => {
|
||||
try {
|
||||
await this._refresh_app_cache();
|
||||
} catch (e) {
|
||||
console.error('App cache failed to update:', e);
|
||||
}
|
||||
}, 30 * 1000);
|
||||
setInterval(async () => {
|
||||
try {
|
||||
await this._refresh_app_stats();
|
||||
await this._refresh_recent_cache();
|
||||
} catch (e) {
|
||||
console.error('App stats cache failed to update:', e);
|
||||
|
||||
}
|
||||
}, 4 * 60 * 1000);
|
||||
setInterval(async () => {
|
||||
try {
|
||||
await this._refresh_app_stat_referrals();// trying this to have both hit less often
|
||||
} catch (e) {
|
||||
console.error('App referral cache failed to update', e);
|
||||
}
|
||||
}, 10.5 * 60 * 1000);
|
||||
})();
|
||||
}, 4 * 60 * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user