]>
Commit | Line | Data |
---|---|---|
9f10b292 C |
1 | 'use strict' |
2 | ||
3 | // API version of our pod | |
f0f5567b | 4 | const API_VERSION = 'v1' |
9f10b292 C |
5 | |
6 | // Score a pod has when we create it as a friend | |
f0f5567b | 7 | let FRIEND_BASE_SCORE = 100 |
9f10b292 C |
8 | |
9 | // Time to wait between requests to the friends | |
f0f5567b | 10 | let INTERVAL = 60000 |
9f10b292 | 11 | |
3fe81fa7 C |
12 | // Number of results by default for the pagination |
13 | const PAGINATION_COUNT_DEFAULT = 15 | |
14 | ||
9f10b292 | 15 | // Number of points we add/remove from a friend after a successful/bad request |
f0f5567b | 16 | const PODS_SCORE = { |
9f10b292 C |
17 | MALUS: -10, |
18 | BONUS: 10 | |
19 | } | |
20 | ||
21 | // Number of retries we make for the make retry requests (to friends...) | |
f0f5567b | 22 | let REQUEST_RETRIES = 10 |
9f10b292 | 23 | |
cbe2f7c3 C |
24 | // Videos thumbnail size |
25 | const THUMBNAILS_SIZE = '200x110' | |
26 | ||
27 | // Path for access to thumbnails with express router | |
28 | const THUMBNAILS_STATIC_PATH = '/static/thumbnails' | |
29 | ||
9f10b292 C |
30 | // Special constants for a test instance |
31 | if (isTestInstance() === true) { | |
32 | FRIEND_BASE_SCORE = 20 | |
33 | INTERVAL = 10000 | |
34 | REQUEST_RETRIES = 2 | |
35 | } | |
36 | ||
37 | // --------------------------------------------------------------------------- | |
38 | ||
39 | module.exports = { | |
40 | API_VERSION: API_VERSION, | |
41 | FRIEND_BASE_SCORE: FRIEND_BASE_SCORE, | |
42 | INTERVAL: INTERVAL, | |
3fe81fa7 | 43 | PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT, |
9f10b292 | 44 | PODS_SCORE: PODS_SCORE, |
cbe2f7c3 C |
45 | REQUEST_RETRIES: REQUEST_RETRIES, |
46 | THUMBNAILS_SIZE: THUMBNAILS_SIZE, | |
47 | THUMBNAILS_STATIC_PATH: THUMBNAILS_STATIC_PATH | |
9f10b292 C |
48 | } |
49 | ||
50 | // --------------------------------------------------------------------------- | |
51 | ||
52 | function isTestInstance () { | |
53 | return (process.env.NODE_ENV === 'test') | |
54 | } |