Welcome to mirror list, hosted at ThFree Co, Russian Federation.

queue_events.js « utils « diffs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 08fcc98d45f18d3bbffebc77a2c61e56f3978cce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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));
  });
}