OL: how to fix a common problem with the waitinglists

For the OL admins: the following solution is implemented with the Upload loan info button, on the Borrow – Administration page.

The lending system is managed through Internet Archive.
When there is a connection problem between IA and OL during a loan update request (returning or borrowing) it is possible that the waitinglist stalls in an undetermined status.

To fix this situation we are using the script:

The script accept three commands:

    if cmd == "update-loans":
    elif cmd == "update-waitinglists":
    elif cmd == "update-waitinglist":

To update and fix a waitinglist we use the update-waitinglist command:

python scripts/openlibrary-server openlibrary.yml runscript scripts/update-loans.py update-waitinglist <InternteArchiveItemId>

:: If the script does not run correctly and you receive this error message:
“Required security token not privided or didn’t match.”
it means you don’t have the ia_ol_shared_key in yours openlibrary.yml

:: Do not run the script as root