title: I'm trying to build System to see all seller weekly income. than nextweek paymentDate need to update but I fail
body: <p>I'm trying to build an e-commerce app. I got a problem. I want every seller's weekly income. Every week payment data need to update automatically so I used agenda Js. But when my server is restarting I can't update data automatically. This is my income route code.</p>
  <pre><code>const joinUpdate = new Date(seller.startAt);
    const paymentDateAt = new Date(seller.paymentDateAt);
    let nowDate = new Date(seller.startAt);
    let Month = new Date(seller.paymentDateAt);
  
  
    agenda.define(&quot;Income&quot; , async job =&gt; {
      nowDate = new Date(joinUpdate.setMinutes(joinUpdate.getMinutes() + 2));
      Month = new Date(paymentDateAt.setMinutes(paymentDateAt.getMinutes() + 2));
      console.log([nowDate , &quot;Testing&quot;]);
      console.log([Month , &quot;Testing&quot;]);
      
      try {
        const updateuser = await Seller.findByIdAndUpdate(req.seller.id , {
          &quot;startAt&quot;:nowDate,
          &quot;paymentDateAt&quot;:Month
        });
      } catch (error) {      
      }  
    })
    
    agenda.every('1 minutes', &quot;Income&quot; ); /// Only for testing
    agenda.start();
  </code></pre>