File tree Expand file tree Collapse file tree 1 file changed +5
-28
lines changed
Expand file tree Collapse file tree 1 file changed +5
-28
lines changed Original file line number Diff line number Diff line change @@ -17,39 +17,16 @@ const assertEnabled = s3 => {
1717 }
1818} ;
1919
20- const isMissingRowlocks = err => err . code === '42883' && err . message === 'function pgrowlocks(unknown) does not exist' ;
21-
2220const getUploadCount = async ( Blobs , limit ) => {
23- try {
24- const pendingCount = await Blobs . s3CountByStatus ( 'pending' ) ;
25- return limit ? Math . min ( pendingCount , limit ) : pendingCount ;
26- } catch ( err ) {
27- if ( isMissingRowlocks ( err ) ) return limit ;
28- else throw err ;
29- }
21+ const pendingCount = await Blobs . s3CountByStatus ( 'pending' ) ;
22+ return limit ? Math . min ( pendingCount , limit ) : pendingCount ;
3023} ;
3124
3225const getCount = withContainer ( ( { s3, Blobs } ) => async status => {
3326 assertEnabled ( s3 ) ;
34- try {
35- const count = await Blobs . s3CountByStatus ( status ) ;
36- console . log ( count ) ;
37- return count ; // just for testing
38- } catch ( err ) {
39- if ( isMissingRowlocks ( err ) ) {
40- console . error ( `
41-
42- Error: cannot count blobs by status due to missing PostgreSQL extension: PGROWLOCKS.
43-
44- To install this extension, execute the following query in your PostgreSQL instance:
45-
46- CREATE EXTENSION IF NOT EXISTS pgrowlocks;
47- ` ) ;
48- process . exit ( 1 ) ;
49- } else {
50- throw err ;
51- }
52- }
27+ const count = await Blobs . s3CountByStatus ( status ) ;
28+ console . log ( count ) ;
29+ return count ; // just for testing
5330} ) ;
5431
5532const setFailedToPending = withContainer ( ( { s3, Blobs } ) => async ( ) => {
You can’t perform that action at this time.
0 commit comments