1 (edited by bdushok 2019-04-17 21:46:24)

Topic: API throttling/delete user throttling? Mass user delete code hangs.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.99
- Deployed with iRedMail Easy or the downloadable installer? downloadable
- Linux/BSD distribution name and version: Centos
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes (3.5)
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Is any throttling applied to API calls or user deletion?   I've written code which deletes users which haven't logged in for more than 365 days.   I've configured last login tracking as described in https://docs.iredmail.org/track.user.last.login.html

My code authenticates to the API by posting to /iredadmin/login.   All is well and I receive the session cookie.   Next, I loop through the MariaDB last_login table for users who haven't logged in for more than 365 days.

Within the loop I access /iredadmin/api/user/(username) using delete and remove the associated record from the MariaDB table.   All is well.   On the second iteration my code hangs when I access /iredadmin/api/user/(username).   No error, not even a timeout.   

If API throttling is in place, can it be disabled?

Thanks,
Bob

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: API throttling/delete user throttling? Mass user delete code hangs.

I might be misunderstanding how authentication works with the API.   I just tried reauthenticating prior to each delete operation and the problem is solved.   Should this be required?

Thanks,
Bob

3

Re: API throttling/delete user throttling? Mass user delete code hangs.

There's no throttling to API access.

bdushok wrote:

I just tried reauthenticating prior to each delete operation and the problem is solved.   Should this be required?

Not sure how you performed the API requests, but you need to make sure the cookie is still valid when perform the API request.