aboutsummaryrefslogtreecommitdiffhomepage
path: root/initializers/constants.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-02-07 11:23:23 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-02-07 11:23:23 +0100
commit9f10b2928df655c3672d9607e864e667d4bc903a (patch)
tree7743911b974b3a7fb0d4c7cec2a723942466b7f1 /initializers/constants.js
parentd7c01e7793d813d804a3b5716d8288f9dcf71a16 (diff)
downloadPeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.tar.gz
PeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.tar.zst
PeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.zip
Remove useless anonymous functions of files
Diffstat (limited to 'initializers/constants.js')
-rw-r--r--initializers/constants.js86
1 files changed, 42 insertions, 44 deletions
diff --git a/initializers/constants.js b/initializers/constants.js
index 1e101a747..16e50443b 100644
--- a/initializers/constants.js
+++ b/initializers/constants.js
@@ -1,44 +1,42 @@
1;(function () { 1'use strict'
2 'use strict' 2
3 3// API version of our pod
4 // API version of our pod 4var API_VERSION = 'v1'
5 var API_VERSION = 'v1' 5
6 6// Score a pod has when we create it as a friend
7 // Score a pod has when we create it as a friend 7var FRIEND_BASE_SCORE = 100
8 var FRIEND_BASE_SCORE = 100 8
9 9// Time to wait between requests to the friends
10 // Time to wait between requests to the friends 10var INTERVAL = 60000
11 var INTERVAL = 60000 11
12 12// Number of points we add/remove from a friend after a successful/bad request
13 // Number of points we add/remove from a friend after a successful/bad request 13var PODS_SCORE = {
14 var PODS_SCORE = { 14 MALUS: -10,
15 MALUS: -10, 15 BONUS: 10
16 BONUS: 10 16}
17 } 17
18 18// Number of retries we make for the make retry requests (to friends...)
19 // Number of retries we make for the make retry requests (to friends...) 19var REQUEST_RETRIES = 10
20 var REQUEST_RETRIES = 10 20
21 21// Special constants for a test instance
22 // Special constants for a test instance 22if (isTestInstance() === true) {
23 if (isTestInstance() === true) { 23 FRIEND_BASE_SCORE = 20
24 FRIEND_BASE_SCORE = 20 24 INTERVAL = 10000
25 INTERVAL = 10000 25 REQUEST_RETRIES = 2
26 REQUEST_RETRIES = 2 26}
27 } 27
28 28// ---------------------------------------------------------------------------
29 // --------------------------------------------------------------------------- 29
30 30module.exports = {
31 module.exports = { 31 API_VERSION: API_VERSION,
32 API_VERSION: API_VERSION, 32 FRIEND_BASE_SCORE: FRIEND_BASE_SCORE,
33 FRIEND_BASE_SCORE: FRIEND_BASE_SCORE, 33 INTERVAL: INTERVAL,
34 INTERVAL: INTERVAL, 34 PODS_SCORE: PODS_SCORE,
35 PODS_SCORE: PODS_SCORE, 35 REQUEST_RETRIES: REQUEST_RETRIES
36 REQUEST_RETRIES: REQUEST_RETRIES 36}
37 } 37
38 38// ---------------------------------------------------------------------------
39 // --------------------------------------------------------------------------- 39
40 40function isTestInstance () {
41 function isTestInstance () { 41 return (process.env.NODE_ENV === 'test')
42 return (process.env.NODE_ENV === 'test') 42}
43 }
44})()