2018-04-04 23:12:35 +09:00
|
|
|
import * as kue from 'kue';
|
|
|
|
|
2018-04-04 23:22:48 +09:00
|
|
|
import request from '../../../remote/request';
|
2018-04-04 23:12:35 +09:00
|
|
|
|
|
|
|
export default async (job: kue.Job, done): Promise<void> => {
|
2018-04-05 18:43:06 +09:00
|
|
|
try {
|
|
|
|
await request(job.data.user, job.data.to, job.data.content);
|
|
|
|
done();
|
|
|
|
} catch (e) {
|
|
|
|
console.warn(`deliver failed: ${e}`);
|
|
|
|
|
|
|
|
done(e);
|
|
|
|
}
|
2018-04-04 23:22:48 +09:00
|
|
|
};
|