restart after error
This commit is contained in:
parent
76b698ada1
commit
136aef6465
7
index.js
7
index.js
|
@ -51,16 +51,19 @@ function search(accounts) {
|
|||
}
|
||||
}
|
||||
main(count, balancesFound)
|
||||
}).catch(emailError)
|
||||
}).catch(emailError, true)
|
||||
}
|
||||
|
||||
function emailError(err){
|
||||
function emailError(err, restart = false){
|
||||
transporter.sendMail({
|
||||
from: '"Random Ethereum Scanner" <foo@example.com>',
|
||||
to: process.env.EMAIL_TO, // Test email address
|
||||
subject: "Error detected",
|
||||
text: err.toString(),
|
||||
}).catch((err)=>{writeToFile('/output/err.txt', err.toString())})
|
||||
if (restart) {
|
||||
main(count, balancesFound)
|
||||
}
|
||||
}
|
||||
|
||||
function writeToFile(filename, message) {
|
||||
|
|
Loading…
Reference in New Issue