Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _getRecoverSlicesQuery(exId, slicerId, cleanupType) {
let query = `ex_id:"${exId}"`;
if (slicerId !== -1) {
query = `${query} AND slicer_id:"${slicerId}"`;
}
if (cleanupType && cleanupType === RecoveryCleanupType.errors) {
query = `${query} AND state:"${SliceState.error}"`;
} else if (cleanupType && cleanupType === RecoveryCleanupType.pending) {
query = `${query} AND state:"${SliceState.pending}"`;
} else {
query = `${query} AND NOT state:"${SliceState.completed}"`;
}
logger.debug('recovery slices query:', query);
return query;
}