debian-mirror-gitlab/app/assets/javascripts/diffs/utils/queue_events.js
2021-10-27 15:23:28 +05:30

13 lines
389 B
JavaScript

import { delay } from 'lodash';
import api from '~/api';
import { DEFER_DURATION } from '../constants';
function trackRedisHllUserEvent(event, deferDuration = 0) {
delay(() => api.trackRedisHllUserEvent(event), deferDuration);
}
export function queueRedisHllEvents(events) {
events.forEach((event, index) => {
trackRedisHllUserEvent(event, DEFER_DURATION * (index + 1));
});
}