0067bee94b
* Add stats updating cloud function * Read stats from database on client instead of computing them * Improve logging for stats updater * Tidying up
16 lines
325 B
TypeScript
16 lines
325 B
TypeScript
import { initAdmin } from './script-init'
|
|
initAdmin()
|
|
|
|
import { log, logMemory } from '../utils'
|
|
import { updateStatsCore } from '../update-stats'
|
|
|
|
async function updateStats() {
|
|
logMemory()
|
|
log('Updating stats...')
|
|
await updateStatsCore()
|
|
}
|
|
|
|
if (require.main === module) {
|
|
updateStats().then(() => process.exit())
|
|
}
|