X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fconstants.ts;h=3908bbf057b07457012ecbfcc6100bdafb5ac494;hb=77239b425a8e00822a53c9907415832a473c3eb6;hp=0d7e7077d7b97b198830884fe7cf12e1ae6533f7;hpb=2e401e8575decb1d491d0db48ca1ab1eba5b2a66;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 0d7e7077d..3908bbf05 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -1,11 +1,12 @@ -import { CronRepeatOptions, EveryRepeatOptions } from 'bull' -import { randomBytes } from 'crypto' +import { RepeatOptions } from 'bullmq' +import { Encoding, randomBytes } from 'crypto' import { invert } from 'lodash' import { join } from 'path' import { randomInt, root } from '@shared/core-utils' import { AbuseState, JobType, + VideoChannelSyncState, VideoImportState, VideoPrivacy, VideoRateType, @@ -19,12 +20,12 @@ import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model' import { VideoPlaylistType } from '../../shared/models/videos/playlist/video-playlist-type.model' // Do not use barrels, remain constants as independent as possible -import { isTestInstance, parseDurationToMs, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' +import { isTestInstance, isTestOrDevInstance, parseDurationToMs, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' import { CONFIG, registerConfigChangedHandler } from './config' // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 715 +const LAST_MIGRATION_VERSION = 745 // --------------------------------------------------------------------------- @@ -64,6 +65,7 @@ const SORTABLE_COLUMNS = { JOBS: [ 'createdAt' ], VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ], VIDEO_IMPORTS: [ 'createdAt' ], + VIDEO_CHANNEL_SYNCS: [ 'externalChannelUrl', 'videoChannel', 'createdAt', 'lastSyncAt', 'state' ], VIDEO_COMMENT_THREADS: [ 'createdAt', 'totalReplies' ], VIDEO_COMMENTS: [ 'createdAt' ], @@ -114,7 +116,8 @@ const ROUTE_CACHE_LIFETIME = { ACTIVITY_PUB: { VIDEOS: '1 second' // 1 second, cache concurrent requests after a broadcast for example }, - STATS: '4 hours' + STATS: '4 hours', + WELL_KNOWN: '1 day' } // --------------------------------------------------------------------------- @@ -129,7 +132,8 @@ const ACTOR_FOLLOW_SCORE = { const FOLLOW_STATES: { [ id: string ]: FollowState } = { PENDING: 'pending', - ACCEPTED: 'accepted' + ACCEPTED: 'accepted', + REJECTED: 'rejected' } const REMOTE_SCHEME = { @@ -155,7 +159,11 @@ const JOB_ATTEMPTS: { [id in JobType]: number } = { 'video-live-ending': 1, 'video-studio-edition': 1, 'manage-video-torrent': 1, - 'move-to-object-storage': 3 + 'video-channel-import': 1, + 'after-video-channel-import': 1, + 'move-to-object-storage': 3, + 'notify': 1, + 'federate-video': 1 } // Excluded keys are jobs that can be configured by admins const JOB_CONCURRENCY: { [id in Exclude]: number } = { @@ -174,7 +182,11 @@ const JOB_CONCURRENCY: { [id in Exclude