How to use the @terascope/job-components.RecoveryCleanupType.errors function in @terascope/job-components

To help you get started, we’ve selected a few @terascope/job-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github terascope / teraslice / packages / teraslice / lib / storage / state.js View on Github external
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;
    }