/* * Copyright (c) 2018 * * This file is licensed under the Affero General Public License version 3 * or later. * * See the COPYING-README file. * */ (function(){ var Semaphore = function(max) { var counter = 0; var waiting = []; this.acquire = function() { if(counter < max) { counter++; return new Promise(function(resolve) { resolve(); }); } else { return new Promise(function(resolve) { waiting.push(resolve); }); } }; this.release = function() { counter--; if (waiting.length > 0 && counter < max) { counter++; var promise = waiting.shift(); promise(); } }; }; // needed on public share page to properly register this if (!OCA.Files) { OCA.Files = {}; } OCA.Files.Semaphore = Semaphore; })(); on> Mirror of redmine code source: https://github.com/redmine/redminewww-data
summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test/queries_test.rb
blob: e253577979f47746f3551f45379a4ac0c1c2a7f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39