summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-12 01:01:25 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-12 01:01:25 +0900
commitd7df75ae6cdfd7743faf33e3bb4a64c8d6df3b78 (patch)
treeb269bb00787ef42e1d9bb627a84f23454f729f1a /src
parent非正規化カラムを削除 (diff)
downloadsharkey-d7df75ae6cdfd7743faf33e3bb4a64c8d6df3b78.tar.gz
sharkey-d7df75ae6cdfd7743faf33e3bb4a64c8d6df3b78.tar.bz2
sharkey-d7df75ae6cdfd7743faf33e3bb4a64c8d6df3b78.zip
Clean up
Diffstat (limited to 'src')
-rw-r--r--src/models/entities/note.ts7
-rw-r--r--src/remote/activitypub/models/question.ts4
-rw-r--r--src/services/note/polls/update.ts18
3 files changed, 0 insertions, 29 deletions
diff --git a/src/models/entities/note.ts b/src/models/entities/note.ts
index 253d157b8c..176fc626b3 100644
--- a/src/models/entities/note.ts
+++ b/src/models/entities/note.ts
@@ -16,13 +16,6 @@ export class Note {
public createdAt: Date;
@Index()
- @Column('timestamp with time zone', {
- nullable: true,
- comment: 'The updated date of the Note.'
- })
- public updatedAt: Date | null;
-
- @Index()
@Column({
...id(),
nullable: true,
diff --git a/src/remote/activitypub/models/question.ts b/src/remote/activitypub/models/question.ts
index 68f0cb3596..2ff8e21ab5 100644
--- a/src/remote/activitypub/models/question.ts
+++ b/src/remote/activitypub/models/question.ts
@@ -68,10 +68,6 @@ export async function updateQuestion(value: any) {
}
}
- await Notes.update(note.id, {
- updatedAt: new Date(),
- });
-
await Polls.update({ noteId: note.id }, {
votes: poll.votes
});
diff --git a/src/services/note/polls/update.ts b/src/services/note/polls/update.ts
index ff8e8d59ef..beb35cc278 100644
--- a/src/services/note/polls/update.ts
+++ b/src/services/note/polls/update.ts
@@ -1,6 +1,3 @@
-import { updateQuestion } from '../../../remote/activitypub/models/question';
-import ms = require('ms');
-import Logger from '../../logger';
import renderUpdate from '../../../remote/activitypub/renderer/update';
import { renderActivity } from '../../../remote/activitypub/renderer';
import { deliver } from '../../../queue';
@@ -8,21 +5,6 @@ import renderNote from '../../../remote/activitypub/renderer/note';
import { Users, Notes, Followings } from '../../../models';
import { Note } from '../../../models/entities/note';
-const logger = new Logger('pollsUpdate');
-
-export async function triggerUpdate(note: Note) {
- if (!note.updatedAt || Date.now() - new Date(note.updatedAt).getTime() > ms('1min')) {
- logger.info(`Updating ${note.id}`);
-
- try {
- const updated = await updateQuestion(note.uri);
- logger.info(`Updated ${note.id} ${updated ? 'changed' : 'nochange'}`);
- } catch (e) {
- logger.error(e);
- }
- }
-}
-
export async function deliverQuestionUpdate(noteId: Note['id']) {
const note = await Notes.findOne(noteId);