Skip to content

Triggers are not cleaned up in modules #281

Open
@dlashua

Description

@dlashua

After more investigation on #277 I've found this.

modules/trig_from_mod.py

def make_simple_trigger(note):
    @time_trigger("period(now, 1sec, now + 30sec)")
    def be_noisy():
        log.info(f'{note}')

    return be_noisy

scripts/quick_test.py

import trig_from_mod as tfm
ITER = 'd'

rt = []
@time_trigger('startup')
def startup():
    rett = tfm.make_simple_trigger(f'{ITER}')
    rt.append(rett)

To reproduce, save file and see logging start. Change ITER and save file again. Notice both sets of logging still occurring.

Moving make_simple_trigger into quick_test.py causes the expected behavior (the logging stops on reload of quick_test.py).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions