diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-13 17:39:41 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 7a7724e66e4533523083e7336cd0d0c747c4a33b (patch) | |
tree | 805299eb9c6829158cd17e5a823a84a3a54d8209 /server/initializers | |
parent | 571389d43b8fc8aaf27e77c06f19b320b08dbbc9 (diff) | |
download | PeerTube-7a7724e66e4533523083e7336cd0d0c747c4a33b.tar.gz PeerTube-7a7724e66e4533523083e7336cd0d0c747c4a33b.tar.zst PeerTube-7a7724e66e4533523083e7336cd0d0c747c4a33b.zip |
Handle follow/accept
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/constants.ts | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 2d61094bd..5d0d39395 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -14,6 +14,7 @@ import { | |||
14 | JobCategory | 14 | JobCategory |
15 | } from '../../shared/models' | 15 | } from '../../shared/models' |
16 | import { VideoPrivacy } from '../../shared/models/videos/video-privacy.enum' | 16 | import { VideoPrivacy } from '../../shared/models/videos/video-privacy.enum' |
17 | import { FollowState } from '../../shared/models/accounts/follow.model' | ||
17 | 18 | ||
18 | // --------------------------------------------------------------------------- | 19 | // --------------------------------------------------------------------------- |
19 | 20 | ||
@@ -34,12 +35,13 @@ const SEARCHABLE_COLUMNS = { | |||
34 | 35 | ||
35 | // Sortable columns per schema | 36 | // Sortable columns per schema |
36 | const SORTABLE_COLUMNS = { | 37 | const SORTABLE_COLUMNS = { |
37 | PODS: [ 'id', 'host', 'score', 'createdAt' ], | ||
38 | USERS: [ 'id', 'username', 'createdAt' ], | 38 | USERS: [ 'id', 'username', 'createdAt' ], |
39 | VIDEO_ABUSES: [ 'id', 'createdAt' ], | 39 | VIDEO_ABUSES: [ 'id', 'createdAt' ], |
40 | VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ], | 40 | VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ], |
41 | VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ], | 41 | VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ], |
42 | BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ] | 42 | BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ], |
43 | FOLLOWERS: [ 'createdAt' ], | ||
44 | FOLLOWING: [ 'createdAt' ] | ||
43 | } | 45 | } |
44 | 46 | ||
45 | const OAUTH_LIFETIME = { | 47 | const OAUTH_LIFETIME = { |
@@ -236,27 +238,10 @@ const PODS_SCORE = { | |||
236 | BONUS: 10 | 238 | BONUS: 10 |
237 | } | 239 | } |
238 | 240 | ||
239 | // Time to wait between requests to the friends (10 min) | 241 | const FOLLOW_STATES: { [ id: string ]: FollowState } = { |
240 | let REQUESTS_INTERVAL = 600000 | 242 | PENDING: 'pending', |
241 | 243 | ACCEPTED: 'accepted' | |
242 | // Number of requests in parallel we can make | 244 | } |
243 | const REQUESTS_IN_PARALLEL = 10 | ||
244 | |||
245 | // To how many pods we send requests | ||
246 | const REQUESTS_LIMIT_PODS = 10 | ||
247 | // How many requests we send to a pod per interval | ||
248 | const REQUESTS_LIMIT_PER_POD = 5 | ||
249 | |||
250 | const REQUESTS_VIDEO_QADU_LIMIT_PODS = 10 | ||
251 | // The QADU requests are not big | ||
252 | const REQUESTS_VIDEO_QADU_LIMIT_PER_POD = 50 | ||
253 | |||
254 | const REQUESTS_VIDEO_EVENT_LIMIT_PODS = 10 | ||
255 | // The EVENTS requests are not big | ||
256 | const REQUESTS_VIDEO_EVENT_LIMIT_PER_POD = 50 | ||
257 | |||
258 | // Number of requests to retry for replay requests module | ||
259 | const RETRY_REQUESTS = 5 | ||
260 | 245 | ||
261 | const REMOTE_SCHEME = { | 246 | const REMOTE_SCHEME = { |
262 | HTTP: 'https', | 247 | HTTP: 'https', |
@@ -333,7 +318,6 @@ const OPENGRAPH_AND_OEMBED_COMMENT = '<!-- open graph and oembed tags -->' | |||
333 | if (isTestInstance() === true) { | 318 | if (isTestInstance() === true) { |
334 | CONSTRAINTS_FIELDS.VIDEOS.DURATION.max = 14 | 319 | CONSTRAINTS_FIELDS.VIDEOS.DURATION.max = 14 |
335 | FRIEND_SCORE.BASE = 20 | 320 | FRIEND_SCORE.BASE = 20 |
336 | REQUESTS_INTERVAL = 10000 | ||
337 | JOBS_FETCHING_INTERVAL = 10000 | 321 | JOBS_FETCHING_INTERVAL = 10000 |
338 | REMOTE_SCHEME.HTTP = 'http' | 322 | REMOTE_SCHEME.HTTP = 'http' |
339 | REMOTE_SCHEME.WS = 'ws' | 323 | REMOTE_SCHEME.WS = 'ws' |
@@ -361,15 +345,7 @@ export { | |||
361 | PODS_SCORE, | 345 | PODS_SCORE, |
362 | PREVIEWS_SIZE, | 346 | PREVIEWS_SIZE, |
363 | REMOTE_SCHEME, | 347 | REMOTE_SCHEME, |
364 | REQUESTS_IN_PARALLEL, | 348 | FOLLOW_STATES, |
365 | REQUESTS_INTERVAL, | ||
366 | REQUESTS_LIMIT_PER_POD, | ||
367 | REQUESTS_LIMIT_PODS, | ||
368 | REQUESTS_VIDEO_EVENT_LIMIT_PER_POD, | ||
369 | REQUESTS_VIDEO_EVENT_LIMIT_PODS, | ||
370 | REQUESTS_VIDEO_QADU_LIMIT_PER_POD, | ||
371 | REQUESTS_VIDEO_QADU_LIMIT_PODS, | ||
372 | RETRY_REQUESTS, | ||
373 | SEARCHABLE_COLUMNS, | 349 | SEARCHABLE_COLUMNS, |
374 | PRIVATE_RSA_KEY_SIZE, | 350 | PRIVATE_RSA_KEY_SIZE, |
375 | SORTABLE_COLUMNS, | 351 | SORTABLE_COLUMNS, |