import { buildPath, isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
import { invert } from 'lodash'
-import { RemoveOldJobsScheduler } from '../lib/schedulers/remove-old-jobs-scheduler'
-import { UpdateVideosScheduler } from '../lib/schedulers/update-videos-scheduler'
// Use a variable to reload the configuration if we need
let config: IConfig = require('config')
// 1 hour
let SCHEDULER_INTERVALS_MS = {
badActorFollow: 60000 * 60, // 1 hour
- removeOldJobs: 60000 * 60, // 1 jour
- updateVideos: 60000 * 1, // 1 minute
+ removeOldJobs: 60000 * 60, // 1 hour
+ updateVideos: 60000 // 1 minute
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
+const TRACKER_RATE_LIMITS = {
+ INTERVAL: 60000 * 5, // 5 minutes
+ ANNOUNCES_PER_IP_PER_INFOHASH: 10, // maximum announces per torrent in the interval
+ ANNOUNCES_PER_IP: 30 // maximum announces for all our torrents in the interval
+}
+
+// ---------------------------------------------------------------------------
+
// Special constants for a test instance
if (isTestInstance() === true) {
ACTOR_FOLLOW_SCORE.BASE = 20
AVATARS_SIZE,
ACCEPT_HEADERS,
BCRYPT_SALT_SIZE,
+ TRACKER_RATE_LIMITS,
CACHE,
CONFIG,
CONSTRAINTS_FIELDS,