Skip to content

Commit

Permalink
feat: run statsHour manually
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjdd committed Mar 4, 2024
1 parent 54c488b commit 53e28a5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion api/next-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,18 @@ AV.Cloud.define('tickAutomation', { fetchUser: false, internal: true }, () => {

AV.Cloud.define('analyzeArticles', { fetchUser: false, internal: true }, analyzeArticles)
AV.Cloud.define('migrateNotifications', { fetchUser: false, internal: true }, migrateNotifications)
AV.Cloud.define('statsHour', () => hourlyTicketStats())
AV.Cloud.define('statsHour', (req) => {
if (req.params.date) {
const date = new Date(req.params.date)
if (isNaN(date.getTime())) {
console.error('Cloud Function - statsHour: invalid date')
return
}
hourlyTicketStats(date)
} else {
hourlyTicketStats()
}
})
AV.Cloud.define('syncTicketLog', () => syncTicketLog())
AV.Cloud.define('dailyPushStatsToSlack', () => dailyPushStatsToSlack())
AV.Cloud.define('weeklyPushStatsToSlack', () => weeklyPushStatsToSlack())
Expand Down

0 comments on commit 53e28a5

Please sign in to comment.