This commit is contained in:
github-actions[bot] 2022-10-10 15:49:09 +00:00 committed by GitHub
commit c7284882df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,9 +25,10 @@ import { newEndpointNoAuth } from './api'
import { getFunctionUrl } from '../../common/api'
const firestore = admin.firestore()
export const scheduleUpdateMetrics = functions.pubsub
.schedule('every 15 minutes')
const TIMEOUT_SECONDS = 2000
export const scheduleUpdateMetrics = functions
.runWith({ timeoutSeconds: TIMEOUT_SECONDS })
.pubsub.schedule('every 15 minutes')
.onRun(async () => {
const response = await fetch(getFunctionUrl('updatemetrics'), {
headers: {
@ -44,7 +45,7 @@ export const scheduleUpdateMetrics = functions.pubsub
})
export const updatemetrics = newEndpointNoAuth(
{ timeoutSeconds: 2000, memory: '8GiB', minInstances: 0 },
{ timeoutSeconds: TIMEOUT_SECONDS, memory: '8GiB', minInstances: 0 },
async (_req) => {
await updateMetricsCore()
return { success: true }