Cannot set "ignoremaxretries" when using updating a workitem using the Python openiap api package/library

As the subject says, I cannot figure out how to set an item back to the ‘new’ state, as I cannot pass the option to ignore the max retries count when updating the workitem from Python.

I guess this is the method that needs an additional argument. I would make a pull request myself, if I knew where to pass the option…

OpenFlow version: 1.5.1
Using self hosted openflow:

import openiap
import os
import asyncio

async def main():
    openflow_url = os.environ.get("openflow_url")
    assert openflow_url is not None
    wiq = os.environ.get("wiq")
    assert wiq is not None

    client = openiap.Client(openflow_url)

    # Do some login
    await client.Signin()

    workitem = await client.PopWorkitem(wiq = wiq)

    workitem.state = "retry"
    workitem.errortype = "application"

    await client.UpdateWorkitem(workitem)
    # How do I ensure the workitem is now new 
    # and not failed if, for instance, it is supposed to run at a later time? 
    # I might want to update nextrun and let it wait a while and then have it run again

Online 160 you ( or I) can add then ignoremaxretries if you also add it to the parameter list on line 146, ( seen here )

I can also do it.
And then I will push the update.

I have added it, and published an update pip package.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

so, i thought i had published it, but when running my publish script it was “stuck” in asking for username/password. so version 0.0.34 was never pushed.
I have fixed that now

1 Like