node.js


node js scheduler iterates 3 times while it supposed to Fire only one Time


i'm trying to schedule a message everyday at 8:00 GMT . The schedule works , the message is sent but 3 times a row . why is that ?
here is my code :
const schedule=require('node-schedule');
const rule=new schedule.RecurrenceRule();
function scheduleCours(senderId, message)
{
rule.dayOfWeek=[0,new schedule.Range(0,6)];
rule.hour=8;
rule.minute=0;
j= schedule.scheduleJob(rule, function(){
var messageData=
{
recipient:
{
id:senderId
},
message: {
attachment: {
type: "template",
payload: {
template_type: "button",
text:message ,
buttons: [{
type: "postback",
title: "J'ai fini",
payload: "fini"
},{
type:"postback",
title:"Annuler",
payload:"Annuler"
}
]
}
}
}
};
callSendAPI(messageData);
});
}
when i call j.cancel() after callSendApi(data) it also iterate three times the message . i have looked online but mostly found responses related to cron. Can someone tell me what is the problem here please ..?

Related Links

Chrome Devtools with no internet connection
electron - process.env.npm_package* variables missing
Mongoose: only show populated results
Woocommerce API Variable Subscription Product update
Alexa Skill - Keep Intent alive for dialogue
Post to google+ wall from plusDomains api
Nodemailer error connect ECONNREFUSED
Node.js not serving files other than index.html
do not run loop queue when specify argument in yeoman generator
cannot pass variables from node js to ejs page
Node.js: how to save uploaded file from browser form?
How to put flash message into my code?
Aggregate method not working as expected
Docker compose version 3 doesn't work as I expected
Ajax call in react js
How to setup an API server with no domain name

Categories

HOME
arduino
slickgrid
asp-classic
maven-lifecycle
servicestack
visual-studio-mac
chromium
raspberry-pi3
aurelia-router
apache-apex
rpres
directive
relation
dijkstra
alexa-voice-service
spring-aop
face-recognition
smt
zillow
qtspim
phylogeny
indexof
geckofx
pi4j
protobuf-c
sequences
lsmeans
psftp
basic4android
powerdesigner
war
toml
each
devexpress-wpf
uievent
keyword-search
auto-value
nsset
html.dropdownlistfor
pywinusb
carplay
react-d3
friend-function
tiles
mypy
oltp
sceditor
google-gadget
machinekey
google-chrome-arc
launch-agent
leshan
sharepoint-userprofile
kindle
markov-models
ienumerable
datepart
openoffice-writer
gethostbyname
polymer-designer-tool
dynamics-nav-2009
sqlsrv
xcode-bots
qubole
eofexception
pull-request
drilldown
apache-roller
circular-buffer
centura
editplus
xcode-instruments
triples
opendocument
interlacing
stencils
c++builder-6
mib
cvxopt
mdbtools
jnetpcap
capability
converters
icefaces-1.8
iphone-4
ctime
launching-application
dynamic-content
glow
snk
layar
installshield-2008
uint32
open-basedir
maintaining-code

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile