File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -63,15 +63,19 @@ class RedisTaskQueue {
6363 async getStatus ( jobId ) {
6464 if ( ! jobId ) return ;
6565 const activeJobs = await this . list ( ) ;
66- const isActive = activeJobs . find ( ( j ) => {
67- return JSON . parse ( j ) . id === jobId ;
68- } ) ;
69- if ( isActive ) return "active" ;
66+ if ( activeJobs && Array . isArray ( activeJobs ) ) {
67+ const isActive = activeJobs . find ( ( j ) => {
68+ return JSON . parse ( j ) . id === jobId ;
69+ } ) ;
70+ if ( isActive ) return "active" ;
71+ }
7072 const buriedJobs = await this . listBuried ( ) ;
71- const isBuried = buriedJobs . find ( ( j ) => {
72- return JSON . parse ( j ) . id === jobId ;
73- } ) ;
74- if ( isBuried ) return "buried" ;
73+ if ( buriedJobs && Array . isArray ( buriedJobs ) ) {
74+ const isBuried = buriedJobs . find ( ( j ) => {
75+ return JSON . parse ( j ) . id === jobId ;
76+ } ) ;
77+ if ( isBuried ) return "buried" ;
78+ }
7579 return "completed" ;
7680 }
7781}
You can’t perform that action at this time.
0 commit comments