Scheduler does not stop on Tick

Wappler Version:3.3.2, 3.3.3, 3.3.5
Operating System:Windows 10 Pro

Expected behavior

scheduler1.running -> false

Actual behavior

scheduler1.running -> true

Server-Model

PHP/ASP.NET

How to reproduce

  1. Add scheduler -> set delay ->add dmx-on:tick=“scheduler1.stop()”

Screenshot 2020-10-03 111644

It works when “scheduler1.stop()” called on button click.

Why are you trying to get it to stop itself? Can you not just use the No repeat property?

Because I want to stop scheduler based on some condition such as :

dmx-on:tick=“myVariable.setValue(myVariable.value + 1); myVariable.value == 10 ? scheduler1.stop() : alert(‘Helllo’)”

OK. Use the scheduler to call a flow and then stop the scheduler from the flow.

@patrick Can you please help?

I will investigate, but isn’t it better to use a flow. You can delay the flow with the Wait step and eventually use that in a while loop if needed. You can parameterize flows, so you can pass variables to set a dynamic delay. There is much more possible using flows.

This is very old code. About 6-8 months old. It was by luck that we did not have any problems with this since we had another overlapping place where we were calling the stop event.

Now that you mention while loop and wait, flow does sound like a better option. I will try to see if I can improve on this logic in our existing code.

Will still be looking out for a response here. :slight_smile:

Seems that there is an issue with calling stop in the same javascript cycle as the tick, using dmx-on:tick.debounce="scheduler1.stop() fixes the issue. Will investigate it further to see if it has negative effects if I delay the start/stop action always.