File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed
src/common/plugins/global Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ ARG TURBO_TOKEN
27
27
ENV TURBO_TOKEN=${TURBO_TOKEN}
28
28
29
29
ARG TURBO_REMOTE_CACHE_SIGNATURE_KEY
30
- ENV TURBO_REMOTE_CACHE_SIGNATURE_KEY=${ TURBO_REMOTE_CACHE_SIGNATURE_KEY}
30
+ ENV TURBO_REMOTE_CACHE_SIGNATURE_KEY=$TURBO_REMOTE_CACHE_SIGNATURE_KEY
31
31
32
32
ENV APP_NAME="cron"
33
33
ENV APP_DIR="apps/${APP_NAME}"
Original file line number Diff line number Diff line change @@ -90,22 +90,21 @@ const cronPlugin: FastifyPluginAsync = async (fastfiy) => {
90
90
}
91
91
92
92
const initializeJobs = async ( ) => {
93
+ console . log ( 'Initializing cron jobs...' )
93
94
if ( ENV . appEnv !== 'production' ) {
94
- console . log ( 'start' )
95
- const immediateRunJobs = jobDescription . filter ( ( job ) => ! ! job . isImmediateExecute )
96
- await Promise . all ( immediateRunJobs . map ( createTick ) )
97
- const crons = immediateRunJobs . map ( createJob )
95
+ const immediateRunJobs = jobDescription . filter ( ( job ) => job . isImmediateExecute )
96
+ const crons = await Promise . all ( immediateRunJobs . map ( createJob ) )
98
97
for ( const cron of crons ) {
99
- console . log ( `${ cron . name } is registered` )
100
98
cron . start ( )
99
+ console . log ( `${ cron . name } is registered` )
101
100
}
102
101
}
103
102
104
- if ( ENV . dockerEnv === 'production' ) {
105
- const crons = jobDescription . map ( createJob )
103
+ if ( [ 'production' , 'stage' ] . includes ( ENV . dockerEnv ) ) {
104
+ const crons = await Promise . all ( jobDescription . map ( createJob ) )
106
105
for ( const cron of crons ) {
107
- console . log ( `${ cron . name } is registered` )
108
106
cron . start ( )
107
+ console . log ( `${ cron . name } is registered` )
109
108
}
110
109
}
111
110
}
Original file line number Diff line number Diff line change 1
1
config :
2
2
aws:region : ap-northeast-2
3
3
velog:DOCKER_ENV : production
4
- velog:target : server
4
+ velog:target : cron
Original file line number Diff line number Diff line change 1
1
config :
2
2
aws:region : ap-northeast-2
3
3
velog:DOCKER_ENV : stage
4
- velog:target : server
4
+ velog:target : cron
You can’t perform that action at this time.
0 commit comments