Commit d610ca85 authored by 郝聪敏's avatar 郝聪敏

添加多个邮箱

parent bdbb828d
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
const Controller = require('egg').Controller; const Controller = require('egg').Controller;
const path = require('path'); const path = require('path');
// const mockMails = `vn1sahsubs@163.com----anncprv // let mockMails = `vn1sahsubs@163----anncprv
// hwm32fxuix@163.com----qfagkir // hwm32fxuix@163.com----qfagkir
// df2srdvgeex@163.com----wvl0ku6 // df2srdvgeex@163.com----wvl0ku6
// heidrck9@163.com----a5isadj // heidrck9@163.com----a5isadj
...@@ -406,7 +406,7 @@ const path = require('path'); ...@@ -406,7 +406,7 @@ const path = require('path');
// mo3q4qv6@163.com----va7ijir50 // mo3q4qv6@163.com----va7ijir50
// tsr8sfk0@163.com----bncs9hs6`.split(/[\s\n]/).map((v, index) => ({ // tsr8sfk0@163.com----bncs9hs6`.split(/[\s\n]/).map((v, index) => ({
// email: v.split('----')[0], id: index, subject: '债权转让通知<公司内测>', // email: v.split('----')[0], id: index, subject: '债权转让通知<公司内测>',
// content: '债权转让通知\r\n\r\n债权转让通知«姓名»,«身份证号»,您通过“«产品名称»”签订的编号为“«channel_order_no»”的《借款合同》(下称“合同”),借款合同编号为“«借款合同编号»”因您逾期未还,我公司已将享有对您的前述债权转让给衡阳市申宏资产经营管理有限公司,债权转让后的权力义务,按原协议约定处理。您应自收到本债转通知之日起向衡阳市申宏资产经营管理有限公司履行还款义务。\r\n\r\n本通知自形成之日即发生法律效力,特此通知!\r\n “«产品名称»”\r\n 鹰潭市信江广达小额贷款股份有限公司2020年 4月 26日\r\n\r\n\r\n\r\n附:债权受让人名称:衡阳市申宏资产经营管理有限公司\r\n开户行:衡阳市农村商业银行高铁支行\r\n账号:82011150001332046\r\n联系电话:0734-8168652\r\n18684909588', // emailContent: '债权转让通知\r\n\r\n债权转让通知«姓名»,«身份证号»,您通过“«产品名称»”签订的编号为“«channel_order_no»”的《借款合同》(下称“合同”),借款合同编号为“«借款合同编号»”因您逾期未还,我公司已将享有对您的前述债权转让给衡阳市申宏资产经营管理有限公司,债权转让后的权力义务,按原协议约定处理。您应自收到本债转通知之日起向衡阳市申宏资产经营管理有限公司履行还款义务。\r\n\r\n本通知自形成之日即发生法律效力,特此通知!\r\n “«产品名称»”\r\n 鹰潭市信江广达小额贷款股份有限公司2020年 4月 26日\r\n\r\n\r\n\r\n附:债权受让人名称:衡阳市申宏资产经营管理有限公司\r\n开户行:衡阳市农村商业银行高铁支行\r\n账号:82011150001332046\r\n联系电话:0734-8168652\r\n18684909588',
// })); // }));
class HomeController extends Controller { class HomeController extends Controller {
...@@ -415,26 +415,41 @@ class HomeController extends Controller { ...@@ -415,26 +415,41 @@ class HomeController extends Controller {
const resource = 'locks:puppeteer'; const resource = 'locks:puppeteer';
const ttl = 60 * 1000; const ttl = 60 * 1000;
let lock = null; let lock = null;
ctx.logger.info('发送任务开始');
try { const excute = async () => {
lock = await app.redlock9.lock(resource, ttl); try {
ctx.logger.info('获取锁成功'); ctx.logger.info('发送任务开始');
const mails = await service.home.getMails(); await new Promise(resolve => setTimeout(() => resolve(), 10000));
const result = await service.home.sendMail(mails); lock = await app.redlock9.lock(resource, ttl);
this.ctx.logger.info(result); ctx.logger.info('获取锁成功');
await service.home.updateStatus(result); const accounts = await service.home.getMailsAccount();
if (lock) lock.unlock(); if (accounts.length) {
ctx.logger.info('解锁成功'); this.ctx.logger.info(accounts);
} catch (e) { const mails = await service.home.getMails();
ctx.logger.error((e && e.message) || '出现未知错误'); const divideMailLength = Math.ceil(mails.length / accounts.length);
if (!lock) { const divideMails = accounts.map((v, index) => ({ ...v, mails: mails.slice(divideMailLength * index, divideMailLength * (index + 1)) }));
ctx.logger.info('未获取到锁'); const results = await Promise.all(divideMails.map(v => service.home.sendMail(v)));
return; this.ctx.logger.info(results.flat());
await service.home.updateStatus(results.flat());
}
if (lock) lock.unlock();
ctx.logger.info('解锁成功');
} catch (e) {
ctx.logger.error((e && e.message) || '出现未知错误');
if (!lock) {
ctx.logger.info('未获取到锁');
return;
}
lock.unlock();
ctx.logger.info('解锁成功');
} }
lock.unlock(); };
ctx.logger.info('解锁成功');
} ctx.runInBackground(async () => {
excute();
});
ctx.body = { code: 0, message: '邮件发送触发成功' };
} }
async publisher() { async publisher() {
......
[{"name":"timezone_offset","value":"-480","domain":".exmail.qq.com","path":"/","expires":-1,"size":19,"httpOnly":false,"secure":false,"session":true},{"name":"tinfo","value":"1591165734.0000","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"pcache","value":"10dcff48f3cdec9MTU5Mzc1NzczNA@763349601@7","domain":".exmail.qq.com","path":"/","expires":1591597734.394307,"size":47,"httpOnly":false,"secure":false,"session":false},{"name":"sid","value":"763349601&60ee52a1ec33522f6a624d7dde2a9c24,cPNmPQyOSqH4.","domain":".exmail.qq.com","path":"/","expires":-1,"size":59,"httpOnly":true,"secure":false,"session":true},{"name":"","value":"0.37248957559032125","domain":"exmail.qq.com","path":"/","expires":-1,"size":19,"httpOnly":false,"secure":false,"session":true},{"name":"qylevel","value":"2","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"dm_login_weixin_rem","value":"","domain":".qq.com","path":"/","expires":1591252133,"size":19,"httpOnly":false,"secure":false,"session":false},{"name":"_gid","value":"GA1.3.1788287499.1591165733","domain":".exmail.qq.com","path":"/","expires":1591252133,"size":31,"httpOnly":false,"secure":false,"session":false},{"name":"logout_page","value":"dm_loginpage","domain":".qq.com","path":"/","expires":1591252133,"size":23,"httpOnly":false,"secure":false,"session":false},{"name":"qm_authimgs_id","value":"0","domain":".qq.com","path":"/","expires":-1,"size":15,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lpvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1591165733","domain":".exmail.qq.com","path":"/","expires":-1,"size":50,"httpOnly":false,"secure":false,"session":true},{"name":"qm_username","value":"763349601","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"username","value":"763349601&763349601","domain":".exmail.qq.com","path":"/","expires":-1,"size":27,"httpOnly":false,"secure":false,"session":true},{"name":"_ga","value":"GA1.3.189918274.1588043915","domain":".exmail.qq.com","path":"/","expires":1654237733,"size":29,"httpOnly":false,"secure":false,"session":false},{"name":"ssl_edition","value":"sail.qq.com","domain":".exmail.qq.com","path":"/","expires":-1,"size":22,"httpOnly":false,"secure":false,"session":true},{"name":"qm_flag","value":"3","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1591165733","domain":".exmail.qq.com","path":"/","expires":1622701733,"size":49,"httpOnly":false,"secure":false,"session":false},{"name":"qm_sk","value":"763349601&yKamb4b5","domain":".exmail.qq.com","path":"/","expires":-1,"size":23,"httpOnly":false,"secure":false,"session":true},{"name":"qm_sid","value":"60ee52a1ec33522f6a624d7dde2a9c24,cPNmPQyOSqH4.","domain":".exmail.qq.com","path":"/","expires":-1,"size":52,"httpOnly":true,"secure":false,"session":true},{"name":"qqmail_alias","value":"tiange.zeng@lkbang.com","domain":".exmail.qq.com","path":"/","expires":-1,"size":34,"httpOnly":false,"secure":false,"session":true},{"name":"qm_ssum","value":"763349601&c56545ad12b06cffaec9393df41ee15f","domain":".exmail.qq.com","path":"/","expires":-1,"size":49,"httpOnly":false,"secure":false,"session":true},{"name":"_gat","value":"1","domain":".exmail.qq.com","path":"/","expires":1591165792,"size":5,"httpOnly":false,"secure":false,"session":false},{"name":"qm_verifyimagesession","value":"h015ba60771a1cc312c3e9a009a389d9fdb41abde02ea86dbb88bc1f0d72dbb78cab1da95b1f93db4fb","domain":".qq.com","path":"/","expires":-1,"size":104,"httpOnly":false,"secure":false,"session":true},{"name":"biz_username","value":"763349601","domain":".exmail.qq.com","path":"/","expires":-1,"size":21,"httpOnly":false,"secure":false,"session":true},{"name":"CCSHOW","value":"0000","domain":".exmail.qq.com","path":"/","expires":1606717734.394209,"size":10,"httpOnly":false,"secure":false,"session":false}]
\ No newline at end of file
[{"name":"timezone_offset","value":"-480","domain":".exmail.qq.com","path":"/","expires":-1,"size":19,"httpOnly":false,"secure":false,"session":true},{"name":"dm_login_weixin_rem","value":"","domain":".qq.com","path":"/","expires":1593766597,"size":19,"httpOnly":false,"secure":false,"session":false},{"name":"qylevel","value":"2","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"tinfo","value":"1593680197.0000","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"pcache","value":"ee2f540061e5773MTU5NjI3MjE5Nw@763349601@7","domain":".exmail.qq.com","path":"/","expires":1594112198.087946,"size":47,"httpOnly":false,"secure":false,"session":false},{"name":"username","value":"763349601&763349601","domain":".exmail.qq.com","path":"/","expires":-1,"size":27,"httpOnly":false,"secure":false,"session":true},{"name":"CCSHOW","value":"0000","domain":".exmail.qq.com","path":"/","expires":1609232198.08782,"size":10,"httpOnly":false,"secure":false,"session":false},{"name":"sid","value":"763349601&ec0ff02cd2ec8f3fc2d6f2ace9a0dc56,cPNmPQ60JD1o.","domain":".exmail.qq.com","path":"/","expires":-1,"size":59,"httpOnly":true,"secure":false,"session":true},{"name":"qm_sid","value":"ec0ff02cd2ec8f3fc2d6f2ace9a0dc56,cPNmPQ60JD1o.","domain":".exmail.qq.com","path":"/","expires":-1,"size":52,"httpOnly":true,"secure":false,"session":true},{"name":"qqmail_alias","value":"tiange.zeng@lkbang.com","domain":".exmail.qq.com","path":"/","expires":-1,"size":34,"httpOnly":false,"secure":false,"session":true},{"name":"","value":"0.6909253932795885","domain":"exmail.qq.com","path":"/","expires":-1,"size":18,"httpOnly":false,"secure":false,"session":true},{"name":"_gid","value":"GA1.3.457217771.1593680196","domain":".exmail.qq.com","path":"/","expires":1593766597,"size":30,"httpOnly":false,"secure":false,"session":false},{"name":"logout_page","value":"dm_loginpage","domain":".qq.com","path":"/","expires":1593766597,"size":23,"httpOnly":false,"secure":false,"session":false},{"name":"biz_username","value":"763349601","domain":".exmail.qq.com","path":"/","expires":-1,"size":21,"httpOnly":false,"secure":false,"session":true},{"name":"qm_verifyimagesession","value":"h01666db4ebb3a0b2d480f49abb1c0b2cc7061e91a095bcf86a86bc83981950188df6236ec4acb1bdf6","domain":".qq.com","path":"/","expires":-1,"size":104,"httpOnly":false,"secure":false,"session":true},{"name":"qm_username","value":"763349601","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lpvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1593680197","domain":".exmail.qq.com","path":"/","expires":-1,"size":50,"httpOnly":false,"secure":false,"session":true},{"name":"qm_authimgs_id","value":"2","domain":".qq.com","path":"/","expires":-1,"size":15,"httpOnly":false,"secure":false,"session":true},{"name":"ssl_edition","value":"sail.qq.com","domain":".exmail.qq.com","path":"/","expires":-1,"size":22,"httpOnly":false,"secure":false,"session":true},{"name":"qm_flag","value":"3","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"_ga","value":"GA1.3.708090953.1593680196","domain":".exmail.qq.com","path":"/","expires":1656752197,"size":29,"httpOnly":false,"secure":false,"session":false},{"name":"qm_ssum","value":"763349601&76ab52ce191d5cf250859eed5ad15c44","domain":".exmail.qq.com","path":"/","expires":-1,"size":49,"httpOnly":false,"secure":false,"session":true},{"name":"_gat","value":"1","domain":".exmail.qq.com","path":"/","expires":1593680256,"size":5,"httpOnly":false,"secure":false,"session":false},{"name":"qm_sk","value":"763349601&yKamb4b5","domain":".exmail.qq.com","path":"/","expires":-1,"size":23,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1593680196","domain":".exmail.qq.com","path":"/","expires":1625216197,"size":49,"httpOnly":false,"secure":false,"session":false}]
\ No newline at end of file
[{"name":"dm_login_weixin_scan","value":"","domain":".qq.com","path":"/","expires":1593766602,"size":20,"httpOnly":false,"secure":false,"session":false},{"name":"timezone_offset","value":"-480","domain":".exmail.qq.com","path":"/","expires":-1,"size":19,"httpOnly":false,"secure":false,"session":true},{"name":"dm_login_weixin_rem","value":"","domain":".qq.com","path":"/","expires":1593766599,"size":19,"httpOnly":false,"secure":false,"session":false},{"name":"qylevel","value":"2","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"tinfo","value":"1593680199.0000","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"pcache","value":"9e200301a45aa39MTU5NjI3MjE5OQ@748969964@7","domain":".exmail.qq.com","path":"/","expires":1594112199.934633,"size":47,"httpOnly":false,"secure":false,"session":false},{"name":"username","value":"748969964&748969964","domain":".exmail.qq.com","path":"/","expires":-1,"size":27,"httpOnly":false,"secure":false,"session":true},{"name":"CCSHOW","value":"0000","domain":".exmail.qq.com","path":"/","expires":1609232199.934506,"size":10,"httpOnly":false,"secure":false,"session":false},{"name":"sid","value":"748969964&0ea77b980d8a43601c410cffdb202f1a,cp94b2VUBBYY.","domain":".exmail.qq.com","path":"/","expires":-1,"size":59,"httpOnly":true,"secure":false,"session":true},{"name":"qm_sid","value":"0ea77b980d8a43601c410cffdb202f1a,cp94b2VUBBYY.","domain":".exmail.qq.com","path":"/","expires":-1,"size":52,"httpOnly":true,"secure":false,"session":true},{"name":"qqmail_alias","value":"notification@lkbang.net","domain":".exmail.qq.com","path":"/","expires":-1,"size":35,"httpOnly":false,"secure":false,"session":true},{"name":"","value":"0.08985075836680734","domain":"exmail.qq.com","path":"/","expires":-1,"size":19,"httpOnly":false,"secure":false,"session":true},{"name":"_gid","value":"GA1.3.1013660193.1593680196","domain":".exmail.qq.com","path":"/","expires":1593766598,"size":31,"httpOnly":false,"secure":false,"session":false},{"name":"logout_page","value":"dm_loginpage","domain":".qq.com","path":"/","expires":1593766599,"size":23,"httpOnly":false,"secure":false,"session":false},{"name":"biz_username","value":"748969964","domain":".exmail.qq.com","path":"/","expires":-1,"size":21,"httpOnly":false,"secure":false,"session":true},{"name":"qm_verifyimagesession","value":"h012fea99abab769af71fb0d7b74deb22c2b6949b95e581127bdd4adb526abae589b06e5e9a4fc4a271","domain":".qq.com","path":"/","expires":-1,"size":104,"httpOnly":false,"secure":false,"session":true},{"name":"qm_username","value":"748969964","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lpvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1593680199","domain":".exmail.qq.com","path":"/","expires":-1,"size":50,"httpOnly":false,"secure":false,"session":true},{"name":"qm_authimgs_id","value":"2","domain":".qq.com","path":"/","expires":-1,"size":15,"httpOnly":false,"secure":false,"session":true},{"name":"ssl_edition","value":"sail.qq.com","domain":".exmail.qq.com","path":"/","expires":-1,"size":22,"httpOnly":false,"secure":false,"session":true},{"name":"qm_flag","value":"3","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"_ga","value":"GA1.3.231478991.1593680196","domain":".exmail.qq.com","path":"/","expires":1656752198,"size":29,"httpOnly":false,"secure":false,"session":false},{"name":"qm_ssum","value":"748969964&3e7acdd3ea2d2a28d81a61dfa799c3bc","domain":".exmail.qq.com","path":"/","expires":-1,"size":49,"httpOnly":false,"secure":false,"session":true},{"name":"_gat","value":"1","domain":".exmail.qq.com","path":"/","expires":1593680256,"size":5,"httpOnly":false,"secure":false,"session":false},{"name":"qm_sk","value":"748969964&yKamb4b5","domain":".exmail.qq.com","path":"/","expires":-1,"size":23,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1593680196","domain":".exmail.qq.com","path":"/","expires":1625216198,"size":49,"httpOnly":false,"secure":false,"session":false}]
\ No newline at end of file
[{"name":"qm_ssum","value":"792529744&b3761a8f7272af95d7f6038e44ac86e9","domain":".exmail.qq.com","path":"/","expires":-1,"size":49,"httpOnly":false,"secure":false,"session":true},{"name":"tinfo","value":"1593766445.0000","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"pcache","value":"3fffb96b247ba11MTU5NjM1ODQ0NQ@792529744@7","domain":".exmail.qq.com","path":"/","expires":1594198445.581441,"size":47,"httpOnly":false,"secure":false,"session":false},{"name":"sid","value":"792529744&d50f3701971c3a8cd1f77d4389f9de9a,c_y9uT-vswyo.","domain":".exmail.qq.com","path":"/","expires":-1,"size":59,"httpOnly":true,"secure":false,"session":true},{"name":"qqmail_alias","value":"notification@lkbang.cn","domain":".exmail.qq.com","path":"/","expires":-1,"size":34,"httpOnly":false,"secure":false,"session":true},{"name":"qm_sid","value":"d50f3701971c3a8cd1f77d4389f9de9a,c_y9uT-vswyo.","domain":".exmail.qq.com","path":"/","expires":-1,"size":52,"httpOnly":true,"secure":false,"session":true},{"name":"_gat","value":"1","domain":".exmail.qq.com","path":"/","expires":1593766504,"size":5,"httpOnly":false,"secure":false,"session":false},{"name":"qm_authimgs_id","value":"1","domain":".qq.com","path":"/","expires":-1,"size":15,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1593680416","domain":".exmail.qq.com","path":"/","expires":1625302444,"size":49,"httpOnly":false,"secure":false,"session":false},{"name":"qm_sk","value":"792529744&yKamb4b5","domain":".exmail.qq.com","path":"/","expires":-1,"size":23,"httpOnly":false,"secure":false,"session":true},{"name":"_ga","value":"GA1.3.2113948605.1593680416","domain":".exmail.qq.com","path":"/","expires":1656838444,"size":30,"httpOnly":false,"secure":false,"session":false},{"name":"ssl_edition","value":"sail.qq.com","domain":".exmail.qq.com","path":"/","expires":-1,"size":22,"httpOnly":false,"secure":false,"session":true},{"name":"qm_flag","value":"3","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"logout_page","value":"dm_loginpage","domain":".qq.com","path":"/","expires":1593852845,"size":23,"httpOnly":false,"secure":false,"session":false},{"name":"_gid","value":"GA1.3.2009892514.1593680416","domain":".exmail.qq.com","path":"/","expires":1593852844,"size":31,"httpOnly":false,"secure":false,"session":false},{"name":"","value":"0.3914092651849508","domain":"exmail.qq.com","path":"/","expires":-1,"size":18,"httpOnly":false,"secure":false,"session":true},{"name":"qm_verifyimagesession","value":"h0195522ac52f3c54a46301036da028690bd0090d7e1357f44952fbc5f393ad0953fe9ef598133995ff","domain":".qq.com","path":"/","expires":-1,"size":104,"httpOnly":false,"secure":false,"session":true},{"name":"biz_username","value":"792529744","domain":".exmail.qq.com","path":"/","expires":-1,"size":21,"httpOnly":false,"secure":false,"session":true},{"name":"dm_login_weixin_rem","value":"","domain":".qq.com","path":"/","expires":1593852845,"size":19,"httpOnly":false,"secure":false,"session":false},{"name":"qylevel","value":"3","domain":".exmail.qq.com","path":"/","expires":-1,"size":8,"httpOnly":false,"secure":false,"session":true},{"name":"CCSHOW","value":"0000","domain":".exmail.qq.com","path":"/","expires":1609318445.581392,"size":10,"httpOnly":false,"secure":false,"session":false},{"name":"username","value":"792529744&792529744","domain":".exmail.qq.com","path":"/","expires":-1,"size":27,"httpOnly":false,"secure":false,"session":true},{"name":"Hm_lpvt_bdfb0d7298c0c5a5a2475c291ac7aca2","value":"1593766445","domain":".exmail.qq.com","path":"/","expires":-1,"size":50,"httpOnly":false,"secure":false,"session":true},{"name":"qm_username","value":"792529744","domain":".exmail.qq.com","path":"/","expires":-1,"size":20,"httpOnly":false,"secure":false,"session":true},{"name":"timezone_offset","value":"-480","domain":".exmail.qq.com","path":"/","expires":-1,"size":19,"httpOnly":false,"secure":false,"session":true}]
\ No newline at end of file
{"MAX_AMOUNT":450,"CURRENT_AMOUNT":0}
\ No newline at end of file
{"MAX_AMOUNT":450,"CURRENT_AMOUNT":0}
\ No newline at end of file
{"MAX_AMOUNT":450,"CURRENT_AMOUNT":0}
\ No newline at end of file
'use strict';
module.exports = {
schedule: {
cron: '0 0 0 * * *',
type: 'worker',
},
async task(ctx) {
ctx.logger.info('重置发信数: 定时任务开始');
await ctx.service.home.refreshMailsAmount();
ctx.logger.info('重置发信数: 定时任务结束');
},
};
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
module.exports = { module.exports = {
schedule: { schedule: {
cron: '0 0 10,11,12,15,16,17,18,19,20 * * *', cron: '0 */30 * * * *',
type: 'worker', type: 'worker',
immediate: true,
}, },
async task(ctx) { async task(ctx) {
ctx.logger.info('定时任务开始'); ctx.logger.info('发送邮件: 定时任务开始');
await ctx.service.home.schedule(); await ctx.service.home.schedule();
ctx.logger.info('定时任务结束'); ctx.logger.info('发送邮件: 定时任务结束');
}, },
}; };
This diff is collapsed.
...@@ -48,7 +48,11 @@ module.exports = appInfo => { ...@@ -48,7 +48,11 @@ module.exports = appInfo => {
aliyun: [ aliyun: [
{ account: 'xyqb@liangkebang.net', password: 'Ztg202020' }, { account: 'xyqb@liangkebang.net', password: 'Ztg202020' },
], ],
tecent: { account: 'Tiange.zeng@lkbang.com', password: 'Ztg2020' }, tecent: [
{ account: 'Tiange.zeng@lkbang.com', password: 'Ztg2020', index: 1 },
{ account: 'notification@lkbang.net', password: 'LHPlhp123', index: 2 },
// { account: 'notification@lkbang.cn', password: 'LHPlhp123', index: 3 },
],
smtp: { smtp: {
host: 'smtp.mxhichina.com', host: 'smtp.mxhichina.com',
port: 465, port: 465,
...@@ -59,7 +63,8 @@ module.exports = appInfo => { ...@@ -59,7 +63,8 @@ module.exports = appInfo => {
}, },
}, },
legal: { legal: {
host: 'http://back-law-urge.q-gp.com', // host: 'http://back-law-urge.q-gp.com',
host: 'https://back-law-urge-fe.liangkebang.net',
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment