Retry HTTP requests
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
import $ from 'cafy';
|
||||
import User from '../../../../models/user';
|
||||
import Following from '../../../../models/following';
|
||||
import queue from '../../../../queue';
|
||||
import { createHttp } from '../../../../queue';
|
||||
|
||||
/**
|
||||
* Follow a user
|
||||
@ -56,7 +56,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
followeeId: followee._id
|
||||
});
|
||||
|
||||
queue.create('http', { type: 'follow', following: _id }).save();
|
||||
createHttp({ type: 'follow', following: _id }).save();
|
||||
|
||||
// Send response
|
||||
res();
|
||||
|
@ -4,7 +4,7 @@
|
||||
import $ from 'cafy';
|
||||
import User from '../../../../models/user';
|
||||
import Following from '../../../../models/following';
|
||||
import queue from '../../../../queue';
|
||||
import { createHttp } from '../../../../queue';
|
||||
|
||||
/**
|
||||
* Unfollow a user
|
||||
@ -49,7 +49,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
|
||||
return rej('already not following');
|
||||
}
|
||||
|
||||
queue.create('http', {
|
||||
createHttp({
|
||||
type: 'unfollow',
|
||||
id: exist._id
|
||||
}).save(error => {
|
||||
|
@ -3,7 +3,7 @@ import * as express from 'express';
|
||||
//const crypto = require('crypto');
|
||||
import User from '../../../models/user';
|
||||
import config from '../../../config';
|
||||
import queue from '../../../queue';
|
||||
import { createHttp } from '../../../queue';
|
||||
|
||||
module.exports = async (app: express.Application) => {
|
||||
if (config.github_bot == null) return;
|
||||
@ -42,7 +42,7 @@ module.exports = async (app: express.Application) => {
|
||||
const commit = event.commit;
|
||||
const parent = commit.parents[0];
|
||||
|
||||
queue.create('http', {
|
||||
createHttp({
|
||||
type: 'gitHubFailureReport',
|
||||
userId: bot._id,
|
||||
parentUrl: parent.url,
|
||||
|
Reference in New Issue
Block a user