Updates to include the new e-mail settings stored in SQL.

This commit is contained in:
Alexander Blair
2017-02-12 14:47:54 -08:00
parent b0981bd189
commit 196ab43ea1
5 changed files with 40 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
2/12/2017
---------
```sql
ALTER TABLE monero_live.config MODIFY item_value TEXT;
```
+1 -1
View File
@@ -42,7 +42,7 @@ CREATE TABLE config
id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
module VARCHAR(32),
item VARCHAR(32),
item_value VARCHAR(128),
item_value TEXT,
item_type VARCHAR(64),
Item_desc VARCHAR(512)
);
+9 -3
View File
@@ -1,6 +1,7 @@
"use strict";
const debug = require("debug")("worker");
const async = require("async");
const sprintf = require("sprintf-js").sprintf;
let threadName = "Worker Server ";
let cycleCount = 0;
@@ -214,9 +215,14 @@ function updateShareStats() {
return;
}
// toAddress, subject, body
global.support.sendEmail(rows[0].email, "Worker " + worker + " not hashing",
"Hello,\r\n\r\nYour worker: " + worker + " has stopped submitting hashes at: " + global.support.formatDate(Date.now()) +
" UTC\r\n\r\nThank you,\r\nXMRPool.net Administration Team");
let emailData = {
worker: worker,
timestamp: global.support.formatDate(Date.now()),
poolEmailSig: global.config.general.emailSig
};
global.support.sendEmail(rows[0].email,
sprintf(global.config.email.workerNotHashingSubject, emailData),
sprintf(global.config.email.workerNotHashingBody, emailData));
});
}
minerStats.hash = 0;
+1
View File
@@ -35,6 +35,7 @@
"request": "^2.79.0",
"request-json": "0.6.1",
"shapeshift.io": "1.3.0",
"sprintf-js": "^1.0.3",
"uuid": "3.0.1",
"wallet-address-validator": "0.1.0"
}
+24
View File
@@ -510,5 +510,29 @@
"item_value": "",
"item_type": "string",
"Item_desc": "Host that receives share information"
},
{
"id": 70,
"module": "email",
"item": "workerNotHashingBody",
"item_value": "Hello,\n\nYour worker: %(worker)s has stopped submitting hashes at: %(timestamp)s UTC\n\nThank you,\n%(poolEmailSig)",
"item_type": "string",
"Item_desc": "Email sent to the miner when their worker stops hashing"
},
{
"id": 71,
"module": "email",
"item": "workerNotHashingSubject",
"item_value": "Worker %(worker)s stopped hashing",
"item_type": "string",
"Item_desc": "Subject of email sent to miner when worker stops hashing"
},
{
"id": 72,
"module": "general",
"item": "emailSig",
"item_value": "NodeJS-Pool Administration Team",
"item_type": "string",
"Item_desc": "Signature line for the emails."
}
]