-
Notifications
You must be signed in to change notification settings - Fork 0
/
cronData.js
executable file
·49 lines (32 loc) · 1.04 KB
/
cronData.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var CronJob = require('cron').CronJob;
var controller = require('./controller');
var config = require('./public/config');
console.log(' -- Automatisme Arrosage/Sensors (required) --')
//---------------------
//Ajout hum/temp/cuve la BASE DE DONNEES
var jobniveau = new CronJob({
cronTime: '*/'+config.addSensors+' * * * *',
onTick: function() {
console.log("*** Auto DB [ Toutes les " + config.timeCycle + " minutes] ***");
controller.MakeData();
},
start: true,
timeZone: 'Europe/Paris'
});
jobniveau.start();
//----------------------
//Arrosage Automatique
/**
var jobarrosage = new CronJob({
cronTime: '00 17 14 * * *',
onTick: function() {
console.log("***Processus Automatique [" + config.timeCycleHours + config.timeCycleMinutes + " ] ***");
controller.Arrosage();
},
start: true,
timeZone: 'Europe/Paris'
});
jobarrosage.start();
// ----------------------
exports.jobArrosage = jobarrosage;*/
exports.jobNiveau = jobniveau;