Skip to content

Commit 60d450e

Browse files
committed
remove catching of errors due to absent pgrowlocks extension
1 parent d32c060 commit 60d450e

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

lib/task/s3.js

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff 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-
2220
const 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

3225
const 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

5532
const setFailedToPending = withContainer(({ s3, Blobs }) => async () => {

0 commit comments

Comments
 (0)