aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/controllers/activitypub/inbox.ts2
-rw-r--r--server/initializers/migrations/0230-kue-to-bull.ts60
2 files changed, 0 insertions, 62 deletions
diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts
index 73fbd94aa..a106df717 100644
--- a/server/controllers/activitypub/inbox.ts
+++ b/server/controllers/activitypub/inbox.ts
@@ -36,8 +36,6 @@ async function inboxController (req: express.Request, res: express.Response, nex
36 const rootActivity: RootActivity = req.body 36 const rootActivity: RootActivity = req.body
37 let activities: Activity[] = [] 37 let activities: Activity[] = []
38 38
39 console.log(rootActivity)
40
41 if ([ 'Collection', 'CollectionPage' ].indexOf(rootActivity.type) !== -1) { 39 if ([ 'Collection', 'CollectionPage' ].indexOf(rootActivity.type) !== -1) {
42 activities = (rootActivity as ActivityPubCollection).items 40 activities = (rootActivity as ActivityPubCollection).items
43 } else if ([ 'OrderedCollection', 'OrderedCollectionPage' ].indexOf(rootActivity.type) !== -1) { 41 } else if ([ 'OrderedCollection', 'OrderedCollectionPage' ].indexOf(rootActivity.type) !== -1) {
diff --git a/server/initializers/migrations/0230-kue-to-bull.ts b/server/initializers/migrations/0230-kue-to-bull.ts
deleted file mode 100644
index 5f4d88bef..000000000
--- a/server/initializers/migrations/0230-kue-to-bull.ts
+++ /dev/null
@@ -1,60 +0,0 @@
1import * as Sequelize from 'sequelize'
2import { createClient } from 'redis'
3import { CONFIG } from '../constants'
4import { JobQueue } from '../../lib/job-queue'
5import { Redis } from '../../lib/redis'
6import { initDatabaseModels } from '../database'
7
8async function up (utils: {
9 transaction: Sequelize.Transaction
10 queryInterface: Sequelize.QueryInterface
11 sequelize: Sequelize.Sequelize
12}): Promise<any> {
13 await initDatabaseModels(false)
14
15 return new Promise((res, rej) => {
16 const client = createClient(Redis.getRedisClient())
17
18 const jobsPrefix = 'q-' + CONFIG.WEBSERVER.HOST
19
20 client.sort(jobsPrefix + ':jobs:inactive', 'by', 'alpha', 'ASC', (err, jobStrings) => {
21 if (err) return rej(err)
22
23 const jobPromises = jobStrings
24 .map(s => s.split('|'))
25 .map(([ , jobId ]) => {
26 return new Promise((res, rej) => {
27 client.hgetall(jobsPrefix + ':job:' + jobId, (err, job) => {
28 if (err) return rej(err)
29
30 try {
31 const parsedData = JSON.parse(job.data)
32
33 return res({ type: job.type, payload: parsedData })
34 } catch (err) {
35 console.error('Cannot parse data %s.', job.data)
36 return res(undefined)
37 }
38 })
39 })
40 })
41
42 JobQueue.Instance.init()
43 .then(() => Promise.all(jobPromises))
44 .then((jobs: any) => {
45 const createJobPromises = jobs
46 .filter(job => job !== null)
47 .map(job => JobQueue.Instance.createJob(job))
48
49 return Promise.all(createJobPromises)
50 })
51 .then(() => res())
52 })
53 })
54}
55
56function down (options) {
57 throw new Error('Not implemented.')
58}
59
60export { up, down }