remove_timer

remove_timer | code

/**
  *  LiquidScheduler uses the remove_timer macro to remove a timer from the timerentry singleton
  *
  *  @param {name} timer - account name to scope the timer within
  *  @param {std::vector<char>} payload - payload to be accessed within the timer_callback function in the consumer contract
  *  @param {uint32_t} seconds - seconds to repeat the cron
  * 
  *  Example:
  *
  *  @code
  *  [[eosio::action]] void testsremove() {
  *    std::vector<char> payload;
  *    remove_timer(_self, payload, 2);
  *  }
  *  @endcode
  */

static void remove_timer(name timer,std::vector<char> payload, uint32_t seconds){  \
    timers_def timers(current_receiver(), timer.value); \
    if(timers.exists()){ \
        timers.remove(); \
    } \
}  \

Last updated