diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-29 16:26:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-30 15:03:18 +0200 |
commit | 6b6168606bc86430f6b7821c9d5f1c80d0425ebf (patch) | |
tree | 9aea6cf0875c9fee30c373eb4924b12d47d1e23c /server/lib/activitypub | |
parent | 2d9fea161fd4fc73994fc77951bafdccdc2071fd (diff) | |
download | PeerTube-6b6168606bc86430f6b7821c9d5f1c80d0425ebf.tar.gz PeerTube-6b6168606bc86430f6b7821c9d5f1c80d0425ebf.tar.zst PeerTube-6b6168606bc86430f6b7821c9d5f1c80d0425ebf.zip |
Bufferize videos views in redis
Diffstat (limited to 'server/lib/activitypub')
-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 75f07d131..16f426e23 100644 --- a/server/lib/activitypub/process/process-create.ts +++ b/server/lib/activitypub/process/process-create.ts | |||
@@ -7,11 +7,11 @@ import { sequelizeTypescript } from '../../../initializers' | |||
7 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' | 7 | import { AccountVideoRateModel } from '../../../models/account/account-video-rate' |
8 | import { ActorModel } from '../../../models/activitypub/actor' | 8 | import { ActorModel } from '../../../models/activitypub/actor' |
9 | import { VideoAbuseModel } from '../../../models/video/video-abuse' | 9 | import { VideoAbuseModel } from '../../../models/video/video-abuse' |
10 | import { VideoCommentModel } from '../../../models/video/video-comment' | ||
11 | import { getOrCreateActorAndServerAndModel } from '../actor' | 10 | import { getOrCreateActorAndServerAndModel } from '../actor' |
12 | import { addVideoComment, resolveThread } from '../video-comments' | 11 | import { addVideoComment, resolveThread } from '../video-comments' |
13 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' | 12 | import { getOrCreateVideoAndAccountAndChannel } from '../videos' |
14 | import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils' | 13 | import { forwardActivity, forwardVideoRelatedActivity } from '../send/utils' |
14 | import { Redis } from '../../redis' | ||
15 | 15 | ||
16 | async function processCreateActivity (activity: ActivityCreate) { | 16 | async function processCreateActivity (activity: ActivityCreate) { |
17 | const activityObject = activity.object | 17 | const activityObject = activity.object |
@@ -88,7 +88,7 @@ async function processCreateView (byActor: ActorModel, activity: ActivityCreate) | |||
88 | const actor = await ActorModel.loadByUrl(view.actor) | 88 | const actor = await ActorModel.loadByUrl(view.actor) |
89 | if (!actor) throw new Error('Unknown actor ' + view.actor) | 89 | if (!actor) throw new Error('Unknown actor ' + view.actor) |
90 | 90 | ||
91 | await video.increment('views') | 91 | await Redis.Instance.addVideoView(video.id) |
92 | 92 | ||
93 | if (video.isOwned()) { | 93 | if (video.isOwned()) { |
94 | // Don't resend the activity to the sender | 94 | // Don't resend the activity to the sender |