<commit_before>const Promise = require('bluebird');
const { jobs } = require('../kue');
const defaults = require('lodash/object/defaults');

const taskOptions = {
    'process-record': { removeOnComplete: true, attempts: 5 },
    'dataset:consolidate': { removeOnComplete: true, attempts: 5 },
    'dgv:publish': { removeOnComplete: true }
};

module.exports = function (taskName, taskData, options = {}) {
    if (taskName in taskOptions) {
        defaults(options, taskOptions[taskName]);
    }

    const job = jobs.create(taskName, taskData);
<commit_msg>Remove finished sync tasks<commit_after>const Promise = require('bluebird');
const { jobs } = require('../kue');
const defaults = require('lodash/object/defaults');

const taskOptions = {
    'process-record': { removeOnComplete: true, attempts: 5 },
    'dataset:consolidate': { removeOnComplete: true, attempts: 5 },
    'dgv:publish': { removeOnComplete: true },
    'udata:synchronizeOne': { removeOnComplete: true }
};

module.exports = function (taskName, taskData, options = {}) {
    if (taskName in taskOptions) {
        defaults(options, taskOptions[taskName]);
    }

    const job = jobs.create(taskName, taskData);

{'fraction_non_alphanumeric': 0.14970563498738435, 'fraction_numerical': 0.00336417157275021, 'mean_word_length': 4.433789954337899, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3064738', 'n_tokens_mistral': 358, 'n_tokens_neox': 351, 'n_words': 84}