@puls-atlas/cli
Version:
The Puls Atlas CLI tool for managing Atlas projects
23 lines • 833 B
JavaScript
import { execSync as defaultExecSync } from './shell.js';
export const ATLAS_SEARCH_TASK_QUEUE_NAME = 'puls-atlas-search';
export const ATLAS_SEARCH_TASK_QUEUE_DEFAULTS = {
logSamplingRatio: 0,
maxAttempts: 10,
maxBackoff: '300s',
maxConcurrentDispatches: 50,
maxDispatchesPerSecond: 20,
maxDoublings: 5,
maxRetryDuration: '0s',
minBackoff: '1s'
};
export const getTaskQueueCreateOptions = (queueName, location, projectId) => ({
location,
project: projectId,
stdio: 'inherit',
...(queueName === ATLAS_SEARCH_TASK_QUEUE_NAME ? ATLAS_SEARCH_TASK_QUEUE_DEFAULTS : {})
});
export const createTaskQueue = async (queueName, location, projectId, {
execSyncImpl = defaultExecSync
} = {}) => execSyncImpl(`gcloud tasks queues create ${queueName}`, {
...getTaskQueueCreateOptions(queueName, location, projectId)
});