-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlistFailedObjects.js
More file actions
31 lines (27 loc) · 1.01 KB
/
listFailedObjects.js
File metadata and controls
31 lines (27 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const { Logger } = require('werelogs');
const { listObjectsByReplicationStatus } = require('./listObjectsByReplicationStatus');
/**
* Backwards compatibility wrapper for listFailedObjects
* This script specifically lists objects with FAILED replication status
* For more flexible replication status filtering, use listObjectsByReplicationStatus.js
*/
if (require.main === module) {
const log = new Logger('s3utils:listFailedObjects');
const BUCKETS = process.argv[2] || null;
const { ACCESS_KEY, SECRET_KEY, ENDPOINT } = process.env;
// Call the main function with FAILED status hardcoded
listObjectsByReplicationStatus({
buckets: BUCKETS,
accessKey: ACCESS_KEY,
secretKey: SECRET_KEY,
endpoint: ENDPOINT,
replicationStatus: 'FAILED',
logger: log,
}).then(() => {
log.info('Completed successfully');
process.exit(0);
}).catch(err => {
log.error('Failed with error', { error: err.message });
process.exit(1);
});
}