debian-mirror-gitlab/app/assets/javascripts/diffs/utils/queue_events.js

14 lines
389 B
JavaScript
Raw Normal View History

2021-10-27 15:23:28 +05:30
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));
});
}