From dfb6e717e438ee95b924b3bc503c3d3674f6fdd6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 19 Apr 2018 08:28:24 +0900 Subject: Update index.ts --- src/queue/index.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'src/queue/index.ts') diff --git a/src/queue/index.ts b/src/queue/index.ts index 88e475dd5d..fd973b077e 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -14,6 +14,7 @@ const queue = createQueue({ export function createHttp(data) { return queue .create('http', data) + .events(false) .attempts(8) .backoff({ delay: 16384, type: 'exponential' }); } -- cgit v1.2.3-freya From 40849a5aa8ac246d81884ffc6b2d1099ff880745 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Apr 2018 07:34:33 +0900 Subject: :v: --- docs/manage.ja.md | 13 +++++++++++++ src/queue/index.ts | 1 + 2 files changed, 14 insertions(+) create mode 100644 docs/manage.ja.md (limited to 'src/queue/index.ts') diff --git a/docs/manage.ja.md b/docs/manage.ja.md new file mode 100644 index 0000000000..d56ed4c19b --- /dev/null +++ b/docs/manage.ja.md @@ -0,0 +1,13 @@ +# 運営ガイド + +## ジョブキューの状態を調べる +Misskeyのディレクトリで: +``` shell +node_modules/kue/bin/kue-dashboard -p 3050 +``` +ポート3050にアクセスするとUIが表示されます + +## ユーザーを凍結する +``` shell +node cli/suspend (ユーザーID) +``` diff --git a/src/queue/index.ts b/src/queue/index.ts index fd973b077e..8338d8398c 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -21,6 +21,7 @@ export function createHttp(data) { export function deliver(user, content, to) { createHttp({ + title: 'deliver', type: 'deliver', user, content, -- cgit v1.2.3-freya From 7ee0cad010f4b357e2515e72f28d7d1f4e2747a2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 22 Apr 2018 07:50:09 +0900 Subject: Fix bug --- src/queue/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/queue/index.ts') diff --git a/src/queue/index.ts b/src/queue/index.ts index 8338d8398c..32fd043f79 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -14,6 +14,7 @@ const queue = createQueue({ export function createHttp(data) { return queue .create('http', data) + .removeOnComplete(true) .events(false) .attempts(8) .backoff({ delay: 16384, type: 'exponential' }); @@ -26,7 +27,7 @@ export function deliver(user, content, to) { user, content, to - }).removeOnComplete(true).save(); + }).save(); } export default function() { -- cgit v1.2.3-freya From 79640d686104a301abe40b20519375350699f971 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 7 May 2018 18:20:15 +0900 Subject: Fix bug --- src/queue/index.ts | 3 ++- src/queue/processors/http/deliver.ts | 1 + src/services/note/create.ts | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/queue/index.ts') diff --git a/src/queue/index.ts b/src/queue/index.ts index 32fd043f79..3f82b30b35 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -2,6 +2,7 @@ import { createQueue } from 'kue'; import config from '../config'; import http from './processors/http'; +import { ILocalUser } from '../models/user'; const queue = createQueue({ redis: { @@ -20,7 +21,7 @@ export function createHttp(data) { .backoff({ delay: 16384, type: 'exponential' }); } -export function deliver(user, content, to) { +export function deliver(user: ILocalUser, content, to) { createHttp({ title: 'deliver', type: 'deliver', diff --git a/src/queue/processors/http/deliver.ts b/src/queue/processors/http/deliver.ts index cf843fad07..0a228c1871 100644 --- a/src/queue/processors/http/deliver.ts +++ b/src/queue/processors/http/deliver.ts @@ -7,6 +7,7 @@ export default async (job: kue.Job, done): Promise => { await request(job.data.user, job.data.to, job.data.content); done(); } catch (res) { + if (res.statusCode == null) return done(); if (res.statusCode >= 400 && res.statusCode < 500) { // HTTPステータスコード4xxはクライアントエラーであり、それはつまり // 何回再送しても成功することはないということなのでエラーにはしないでおく diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 634c2e263d..9320889c2b 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -295,9 +295,11 @@ export default async (user: IUser, data: { nm.push(u._id, 'mention'); }); - mentionedUsers.filter(u => isRemoteUser(u)).forEach(async u => { - deliver(user, await render(), (u as IRemoteUser).inbox); - }); + if (isLocalUser(user)) { + mentionedUsers.filter(u => isRemoteUser(u)).forEach(async u => { + deliver(user, await render(), (u as IRemoteUser).inbox); + }); + } // Append mentions data if (mentionedUsers.length > 0) { -- cgit v1.2.3-freya