summaryrefslogtreecommitdiff
path: root/src/stream.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream.ts')
-rw-r--r--src/stream.ts18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/stream.ts b/src/stream.ts
index 8ca8c3254c..596cb98e72 100644
--- a/src/stream.ts
+++ b/src/stream.ts
@@ -1,31 +1,17 @@
import * as mongo from 'mongodb';
import redis from './db/redis';
import Xev from 'xev';
-import { IMeta } from './models/meta';
-import fetchMeta from './misc/fetch-meta';
type ID = string | mongo.ObjectID;
class Publisher {
private ev: Xev;
- private meta: IMeta;
constructor() {
// Redisがインストールされてないときはプロセス間通信を使う
if (redis == null) {
this.ev = new Xev();
}
-
- setInterval(async () => {
- this.meta = await fetchMeta();
- }, 5000);
- }
-
- public fetchMeta = async () => {
- if (this.meta != null) return this.meta;
-
- this.meta = await fetchMeta();
- return this.meta;
}
private publish = (channel: string, type: string, value?: any): void => {
@@ -83,14 +69,10 @@ class Publisher {
}
public publishLocalTimelineStream = async (note: any): Promise<void> => {
- const meta = await this.fetchMeta();
- if (meta.disableLocalTimeline) return;
this.publish('localTimeline', null, note);
}
public publishHybridTimelineStream = async (userId: ID, note: any): Promise<void> => {
- const meta = await this.fetchMeta();
- if (meta.disableLocalTimeline) return;
this.publish(userId ? `hybridTimeline:${userId}` : 'hybridTimeline', null, note);
}