ynput / ayon-backend

Server codebase with API access to AYON
Apache License 2.0
22 stars 16 forks source link

Cleanup of Site Records #406

Open martastain opened 1 month ago

martastain commented 1 month ago

Currently, the server does not offer a straightforward way to unregister sites. Once a site is registered, it remains in the database indefinitely. This can lead to the accumulation of orphaned site IDs, especially when sites are created and later abandoned. These unused sites often don’t utilize settings overrides or custom roots, resulting in unnecessary database clutter.

Proposal

Automated clean-up

Add a last_active field to each site record to track when it was last used. For older sites, the default value can be set to the time the server was updated to the version that first supports this feature (as proposed in https://github.com/ynput/ayon-backend/issues/405 )

After a designated grace period (e.g., one month), any sites that have been inactive and do not have settings overrides or custom roots will be deleted automatically.

Manual clean-up

Dedicated page in the web interface with sites overview (connected users, last active, has settings overrides, has roots....) where administrators could delete sites manually