Skip to content

Commit e61c63b

Browse files
abbas-nazaractions-user
authored andcommitted
fix: moved sendCommentsNotificationEmails to studio service
GitOrigin-RevId: 89ac46b0f5b4786b6cf71b66fa8a48cda0084e25
1 parent 54911e2 commit e61c63b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

platform/wab/src/wab/server/AppServer.ts

-6
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ import {
272272
getWorkspaces,
273273
updateWorkspace,
274274
} from "@/wab/server/routes/workspaces";
275-
import { sendCommentsNotificationEmails } from "@/wab/server/scripts/send-comments-notifications";
276275
import { logError } from "@/wab/server/server-util";
277276
import { ASYNC_TIMING } from "@/wab/server/timing-util";
278277
import { TypeormStore } from "@/wab/server/util/TypeormSessionStore";
@@ -2120,11 +2119,6 @@ export async function createApp(
21202119
pruneCache();
21212120
});
21222121

2123-
// runs every 10 minutes
2124-
cron.schedule("*/10 * * * *", async () => {
2125-
await sendCommentsNotificationEmails(config);
2126-
});
2127-
21282122
// Don't leak infra info
21292123
app.disable("x-powered-by");
21302124

platform/wab/src/wab/server/app-backend-real.ts

+8
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ import * as childProcess from "child_process";
1515
import "core-js";
1616
import * as fs from "fs";
1717
import http from "http";
18+
import cron from "node-cron";
1819
import * as path from "path";
1920
// Must initialize globals early so that imported code can detect what
2021
// environment we're running in.
2122
import { addSocketRoutes } from "@/wab/server/app-socket-backend-real";
2223
import { Config } from "@/wab/server/config";
24+
import { sendCommentsNotificationEmails } from "@/wab/server/scripts/send-comments-notifications";
2325
import httpProxy from "http-proxy";
2426

2527
export async function runAppServer(config: Config) {
@@ -72,6 +74,12 @@ export async function runAppServer(config: Config) {
7274
}
7375
}
7476
);
77+
78+
// runs every 10 minutes
79+
cron.schedule("*/10 * * * *", async () => {
80+
await sendCommentsNotificationEmails(config);
81+
});
82+
7583
return runExpressApp(app, (server) => {
7684
// Upon upgrading to websocket, also proxy to socket server
7785
if (socketProxy) {

0 commit comments

Comments
 (0)