Re: [mh] eval_with_timer and reloads
Richard F via misterhouse-users <[email protected]>
| Newsgroups | gmane.comp.misc.misterhouse.user |
|---|---|
| Organization | Keynet Technology |
| Message-ID | <[email protected]> |
Brian,
I think you might be being a little optimistic, I think the
eval_with_timer was meant as a bit of a fudge anyway, and you're wanting
the fudge to be maintained between code reloads. I deliberately avoided
run-time reloads because there are other possible side effects,
opportunities for mh to stop if the code is bad, plus unnecessary
interruptions, logspam etc. Best avoided for smooth running.
Triggers don't *have* to cause reloads - that's what I'd look at. It's
so long ago I can't remember how I eliminated them all, but I have about
30 and no reloads. One thing I do recall is that changing a time_now
value requires a reload to action it, but using a $Save variable avoids
it, so I update a $Save variable instead, e.g. time_now
'$Save{hvac_living_start}' - that accounts for about 10 of my triggers.
You can have as many of those as you like, and like the name says, they
get saved through restarts/reloads too.
HTH - Richard
On 3/05/2019 16:29, Brian M wrote:
>
> It appears that anytime MH reloads configuration information and user
> code, any existing eval_with_timer timers are deleted. In particular,
> if I have a task scheduled via the Triggers menu, and that task wants
> to spin off sub-tasks using eval_with_timer, those sub-tasks will
> never execute because executing any task via Triggers runs a Reload
> afterwards. The sequence of events appears to be:
>
> 1. Trigger entry runs a task (a piece of user code)
> 2. Task schedules several sub-tasks using eval_with_timer and exits.
> The timing of the sub-tasks varies with each run based on current
> conditions, and are not convenient to add directly to the Trigger
> menu.
> 3. Trigger processing runs a Reload after the end of the task
> 4. Sub-tasks are deleted and never execute
>
> Is there a way to use eval_with_timer such that the scheduled item
> survives a Reload? Is there another way I should approach this?
>
> -Brian
>
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users