File tree 2 files changed +8
-6
lines changed
platform/wab/src/wab/server
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,6 @@ import {
272
272
getWorkspaces ,
273
273
updateWorkspace ,
274
274
} from "@/wab/server/routes/workspaces" ;
275
- import { sendCommentsNotificationEmails } from "@/wab/server/scripts/send-comments-notifications" ;
276
275
import { logError } from "@/wab/server/server-util" ;
277
276
import { ASYNC_TIMING } from "@/wab/server/timing-util" ;
278
277
import { TypeormStore } from "@/wab/server/util/TypeormSessionStore" ;
@@ -2120,11 +2119,6 @@ export async function createApp(
2120
2119
pruneCache ( ) ;
2121
2120
} ) ;
2122
2121
2123
- // runs every 10 minutes
2124
- cron . schedule ( "*/10 * * * *" , async ( ) => {
2125
- await sendCommentsNotificationEmails ( config ) ;
2126
- } ) ;
2127
-
2128
2122
// Don't leak infra info
2129
2123
app . disable ( "x-powered-by" ) ;
2130
2124
Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ import * as childProcess from "child_process";
15
15
import "core-js" ;
16
16
import * as fs from "fs" ;
17
17
import http from "http" ;
18
+ import cron from "node-cron" ;
18
19
import * as path from "path" ;
19
20
// Must initialize globals early so that imported code can detect what
20
21
// environment we're running in.
21
22
import { addSocketRoutes } from "@/wab/server/app-socket-backend-real" ;
22
23
import { Config } from "@/wab/server/config" ;
24
+ import { sendCommentsNotificationEmails } from "@/wab/server/scripts/send-comments-notifications" ;
23
25
import httpProxy from "http-proxy" ;
24
26
25
27
export async function runAppServer ( config : Config ) {
@@ -72,6 +74,12 @@ export async function runAppServer(config: Config) {
72
74
}
73
75
}
74
76
) ;
77
+
78
+ // runs every 10 minutes
79
+ cron . schedule ( "*/10 * * * *" , async ( ) => {
80
+ await sendCommentsNotificationEmails ( config ) ;
81
+ } ) ;
82
+
75
83
return runExpressApp ( app , ( server ) => {
76
84
// Upon upgrading to websocket, also proxy to socket server
77
85
if ( socketProxy ) {
You can’t perform that action at this time.
0 commit comments