From d9bdd007d7a1368d2a13127ecb5c0a81a18a8c04 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Sep 2018 16:12:07 +0200 Subject: Put config redundancy strategies in "strategies" subkey --- server/lib/activitypub/actor.ts | 3 +++ server/lib/schedulers/videos-redundancy-scheduler.ts | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'server/lib') diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index 0bdb7d12e..d37a695a7 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts @@ -78,6 +78,9 @@ async function getOrCreateActorAndServerAndModel ( created = true } + if (actor.Account) actor.Account.Actor = actor + if (actor.VideoChannel) actor.VideoChannel.Actor = actor + const { actor: actorRefreshed, refreshed } = await retryTransactionWrapper(refreshActorIfNeeded, actor, fetchType) if (!actorRefreshed) throw new Error('Actor ' + actorRefreshed.url + ' does not exist anymore.') diff --git a/server/lib/schedulers/videos-redundancy-scheduler.ts b/server/lib/schedulers/videos-redundancy-scheduler.ts index 7079600a9..5f9fd9911 100644 --- a/server/lib/schedulers/videos-redundancy-scheduler.ts +++ b/server/lib/schedulers/videos-redundancy-scheduler.ts @@ -1,10 +1,9 @@ import { AbstractScheduler } from './abstract-scheduler' import { CONFIG, JOB_TTL, REDUNDANCY, SCHEDULER_INTERVALS_MS } from '../../initializers' import { logger } from '../../helpers/logger' -import { RecentlyAddedStrategy, VideoRedundancyStrategy, VideosRedundancy } from '../../../shared/models/redundancy' +import { VideoRedundancyStrategy, VideosRedundancy } from '../../../shared/models/redundancy' import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' import { VideoFileModel } from '../../models/video/video-file' -import { sortBy } from 'lodash' import { downloadWebTorrentVideo } from '../../helpers/webtorrent' import { join } from 'path' import { rename } from 'fs-extra' @@ -12,7 +11,6 @@ import { getServerActor } from '../../helpers/utils' import { sendCreateCacheFile, sendUpdateCacheFile } from '../activitypub/send' import { VideoModel } from '../../models/video/video' import { getVideoCacheFileActivityPubUrl } from '../activitypub/url' -import { removeVideoRedundancy } from '../redundancy' import { isTestInstance } from '../../helpers/core-utils' export class VideosRedundancyScheduler extends AbstractScheduler { @@ -31,7 +29,7 @@ export class VideosRedundancyScheduler extends AbstractScheduler { this.executing = true - for (const obj of CONFIG.REDUNDANCY.VIDEOS) { + for (const obj of CONFIG.REDUNDANCY.VIDEOS.STRATEGIES) { try { const videoToDuplicate = await this.findVideoToDuplicate(obj) if (!videoToDuplicate) continue -- cgit v1.2.3