File tree Expand file tree Collapse file tree 5 files changed +43
-12
lines changed
atrium-telegram/server/plugins
core-telegram/server/plugins Expand file tree Collapse file tree 5 files changed +43
-12
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,24 @@ import { queue } from '@roll-stack/queue'
55 * Queue init
66 */
77export default defineNitroPlugin ( async ( ) => {
8+ const logger = useLogger ( 'plugin:start-queue' )
9+
10+ if ( process . env . NODE_ENV !== 'production' && ! process . env . QUEUE_URL ) {
11+ logger . info ( 'Skipping in non-production environment' )
12+ return
13+ }
14+
815 if ( ! process . env . QUEUE_URL ) {
916 throw new Error ( 'QUEUE_URL is not defined' )
1017 }
1118
12- await queue . connect ( process . env . QUEUE_URL )
19+ try {
20+ await queue . connect ( process . env . QUEUE_URL , 10 )
21+ } catch ( error ) {
22+ // Have a problem
23+ logger . error ( error )
24+
25+ // System
26+ process . exit ( 1 )
27+ }
1328} )
Original file line number Diff line number Diff line change @@ -9,15 +9,23 @@ export default defineNitroPlugin(async () => {
99 const logger = useLogger ( 'plugin:start-queue' )
1010
1111 if ( process . env . NODE_ENV !== 'production' && ! process . env . QUEUE_URL ) {
12- logger . info ( 'Skipping Queue in non-production environment' )
12+ logger . info ( 'Skipping in non-production environment' )
1313 return
1414 }
1515
1616 if ( ! process . env . QUEUE_URL ) {
1717 throw new Error ( 'QUEUE_URL is not defined' )
1818 }
1919
20- await queue . connect ( process . env . QUEUE_URL )
20+ try {
21+ await queue . connect ( process . env . QUEUE_URL , 10 )
22+ } catch ( error ) {
23+ // Have a problem
24+ logger . error ( error )
25+
26+ // System
27+ process . exit ( 1 )
28+ }
2129
2230 await setupConsumers ( )
2331} )
Original file line number Diff line number Diff line change @@ -8,13 +8,21 @@ export default defineNitroPlugin(async () => {
88 const logger = useLogger ( 'plugin:start-queue' )
99
1010 if ( process . env . NODE_ENV !== 'production' && ! process . env . QUEUE_URL ) {
11- logger . info ( 'Skipping Queue in non-production environment' )
11+ logger . info ( 'Skipping in non-production environment' )
1212 return
1313 }
1414
1515 if ( ! process . env . QUEUE_URL ) {
1616 throw new Error ( 'QUEUE_URL is not defined' )
1717 }
1818
19- await queue . connect ( process . env . QUEUE_URL )
19+ try {
20+ await queue . connect ( process . env . QUEUE_URL , 10 )
21+ } catch ( error ) {
22+ // Have a problem
23+ logger . error ( error )
24+
25+ // System
26+ process . exit ( 1 )
27+ }
2028} )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ catalogs:
3333 ' @date-fns/tz ' : ^1.4.1
3434 ' @internationalized/date ' : ^3.10.0
3535 ' @neoconfetti/vue ' : ^2.2.1
36- ' @nextorders/queue ' : ^0.4.0
36+ ' @nextorders/queue ' : ^0.4.2
3737 ' @nuxt/ui ' : ^4.1.0
3838 ' @openai/agents ' : ^0.2.1
3939 ' @paralleldrive/cuid2 ' : 2.2.2
You can’t perform that action at this time.
0 commit comments