#!jinja2
[meta]
    title=Task Event Handler Retry
    URL = http://my-suites.com/${CYLC_SUITE_NAME}.html

[scheduling]
    [[graph]]
        R1="t1 => t2"

[runtime]
    [[t1]]
        script=true
        [[[meta]]]
            URL = http://my-suites.com/${CYLC_SUITE_NAME}/${CYLC_TASK_NAME}.html
{% if HOST is defined %}
        [[[remote]]]
            host = {{HOST}}
{% endif %}
{% if GLOBALCFG is not defined %}
        [[[events]]]
            handlers = hello-event-handler %(name)s %(event)s %(suite_url)s %(suite_uuid)s %(task_url)s %(message)s %(point)s %(submit_num)s %(id)s
            handler events=succeeded, failed
            handler retry delays=PT0S, 2*PT1S
{% endif %}{# not GLOBALCFG is not defined #}
    [[t2]]
        script="""
LOG="${CYLC_SUITE_LOG_DIR}/../job/1/t1/NN/job-activity.log"
STR="[(('event-handler-00', 'succeeded'), 1) ret_code] 0"
timeout 30 bash -c "while ! grep -q -F \"${STR}\" '${LOG}'; do sleep 1; done"
"""
