diff options
author | Chocobozzz <me@florianbigard.com> | 2018-10-02 14:39:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-10-02 14:40:03 +0200 |
commit | b88a459664957d6ab9c417a6749b611e6cc6c0e2 (patch) | |
tree | 182ff8c00155cbdaba3f0c054ae944b2f282b7ab /server/lib/activitypub/process/process-create.ts | |
parent | 278711b595aaaa6c3f77c160cc41b1b48c997e9a (diff) | |
download | PeerTube-b88a459664957d6ab9c417a6749b611e6cc6c0e2.tar.gz PeerTube-b88a459664957d6ab9c417a6749b611e6cc6c0e2.tar.zst PeerTube-b88a459664957d6ab9c417a6749b611e6cc6c0e2.zip |
Upsert cache file on create activity
Diffstat (limited to 'server/lib/activitypub/process/process-create.ts')
-rw-r--r-- | server/lib/activitypub/process/process-create.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/lib/activitypub/process/process-create.ts b/server/lib/activitypub/process/process-create.ts index c2160872f..cefe89db0 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -11,7 +11,7 @@ import { addVideoComment, resolveThread } from '../video-comments' | |||
11 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' | 11 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' |
12 | import { forwardVideoRelatedActivity } from '../send/utils' | 12 | import { forwardVideoRelatedActivity } from '../send/utils' |
13 | import { Redis } from '../../redis' | 13 | import { Redis } from '../../redis' |
14 | import { createCacheFile } from '../cache-file' | 14 | import { createOrUpdateCacheFile } from '../cache-file' |
15 | 15 | ||
16 | async function processCreateActivity (activity: ActivityCreate, byActor: ActorModel) { | 16 | async function processCreateActivity (activity: ActivityCreate, byActor: ActorModel) { |
17 | const activityObject = activity.object | 17 | const activityObject = activity.object |
@@ -105,7 +105,7 @@ async function processCacheFile (byActor: ActorModel, activity: ActivityCreate) | |||
105 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: cacheFile.object }) | 105 | const { video } = await getOrCreateVideoAndAccountAndChannel({ videoObject: cacheFile.object }) |
106 | 106 | ||
107 | await sequelizeTypescript.transaction(async t => { | 107 | await sequelizeTypescript.transaction(async t => { |
108 | return createCacheFile(cacheFile, video, byActor, t) | 108 | return createOrUpdateCacheFile(cacheFile, video, byActor, t) |
109 | }) | 109 | }) |
110 | 110 | ||
111 | if (video.isOwned()) { | 111 | if (video.isOwned()) { |