How to disable jsreport correctly?



  • Hi,

    i am using jsreport-core in node.js to develop an application that uses the jsreport-scheduling extension to create schedules that saves/emails the created the reported.
    I want to give the user the option to be able to enable/disable the schedule.
    I am disabling/enabling the schedule by updating the existing schedule in the following manner :-

    jsreport.documentStore.collection("schedules").update(
              { _id: schedule._id },
              {
                $set: {
                  enabled: args.enabled
                }
              });
    

    Now after disabling the schedule by setting enabled: false, whenever i enable it again by enabled: true, the scheduler generates and emails the report multiple times.

    For example - If my scheduler runs every 5 mins and i disable it for 20 mins. Then when i enable it again, it runs 4 times.

    How can i prevent this from happening? I want the scheduler to run only once after i enable it.



  • Hi,
    thanks for reporting this.
    It seems we missed this in the implementation. We will fix it here
    https://github.com/jsreport/jsreport-scheduling/issues/9


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.