AcademySoftwareFoundation / OpenCue

A render management system you can deploy for visual effects and animation productions.
https://www.opencue.io
Apache License 2.0
832 stars 202 forks source link

Recalculate subs logic needs a cron trigger #1562

Open DiegoTavares opened 3 weeks ago

DiegoTavares commented 3 weeks ago

Describe the bug Subscription accountability has a condition where, when running at large scale, values can become out of date. This bug exists since cue3 and a hotfix has been in place at imageworks since it was first uncovered. The root cause for this issue has never been fixed.

The hotfix was integrated into the open source repo at https://github.com/AcademySoftwareFoundation/OpenCue/pull/1380 as a database function, but this function needs to be called on a schedule, something that's not possible (AFAIK) on postgres. SPI's current setup uses a cronjob on the db server to trigger the function every 2 hours, but this setup is far from ideal.

Expected behavior

Ideally this function should be called on a schedule by cuebot and not require an external cronjob. Something to take into consideration is that cuebot might have multiple instances active.