Hi guys,
The last friday at 6 cet there seemed that anvil was down for a short period of time.
In my case i have a background task which runs every minute and sends an email if a device is offline/online. The background task needs access to the anvil database.
The error that i get is the following.
anvil.tables.TableError: Internal database error: ERROR: canceling statement due to user request
<running on the server>
called from /downlink/anvil/_server.py, line 43
called from BackgroundTasks, line 63
Which in the context of the script is the last two lines which is failing. How can i prevent this error?
if device_online:
#dt_send = datetime.datetime.fromtimestamp(last_active).strftime("%Y-%m-%d %H:%M:%S")
dt_send = ConvertLastActiveTime(last_active)
anvil.server.call('send_error', f"{device_name} is offline. is was last active {dt_send}", device_email)
r = app_tables.devices.get(license_code=device_serial)
r.update(online=False)