From feab93e5f894c36f54659d2b9d6508ac964c1428 Mon Sep 17 00:00:00 2001 From: panjunwen Date: Tue, 18 Sep 2018 14:17:12 +0800 Subject: [PATCH] fix bugs --- cloud.js | 8 ++++++++ package.json | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cloud.js b/cloud.js index 93f450f48..c7adf6a01 100644 --- a/cloud.js +++ b/cloud.js @@ -1,6 +1,7 @@ const AV = require('leanengine'); const mail = require('./utilities/send-mail'); const Comment = AV.Object.extend('Comment'); +const request = require('request'); function sendNotification(currentComment) { // 发送博主通知邮件 @@ -53,3 +54,10 @@ AV.Cloud.define('resend-mails', function(request) { }); }); }); + +AV.Cloud.define('self-wake', function(request) { + request(process.env.ADMIN_URL, function (error, response, body) { + console.log('自唤醒任务执行成功,响应状态码为:', response && response.statusCode); + }); +}) + diff --git a/package.json b/package.json index 8a609a3dd..9e4178adc 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "express": "4.12.3", "leancloud-storage": "^3.0.0", "leanengine": "^3.0.0", - "nodemailer": "^4.0.1" + "nodemailer": "^4.0.1", + "requests": "^0.2.2" }, "devDependencies": { "nodemon": "^1.11.0"