Skip to content

Commit ce2ac15

Browse files
committed
Only schedule when not testing
1 parent 7950389 commit ce2ac15

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Sources/Grodt/Application/routes.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ func routes(_ app: Application) async throws {
7777
try routeBuilder.register(collection: investmentsController)
7878
}
7979

80-
let portfolioUpdaterJob = PortfolioPerformanceUpdaterJob(performanceUpdater: portfolioPerformanceUpdater)
81-
app.queues.schedule(portfolioUpdaterJob)
82-
.daily()
83-
.at(3, 0)
84-
app.queues.add(LoggingJobEventDelegate(logger: app.logger))
85-
try app.queues.startScheduledJobs()
86-
try app.queues.startInProcessJobs()
80+
if app.environment != .testing {
81+
let portfolioUpdaterJob = PortfolioPerformanceUpdaterJob(performanceUpdater: portfolioPerformanceUpdater)
82+
app.queues.schedule(portfolioUpdaterJob)
83+
.daily()
84+
.at(3, 0)
85+
app.queues.add(LoggingJobEventDelegate(logger: app.logger))
86+
try app.queues.startScheduledJobs()
87+
try app.queues.startInProcessJobs()
88+
}
8789
}

0 commit comments

Comments
 (0)