You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever the file upload URL endpoint is accessed, it creates an entry in the File table for that file. As this generally happens prior to the creation of a ContentNode or AssessmentItem associated with this file, if no ContentNode or AssessmentItem are created, then this can leave a File object that is not attached to any specific object.
This has been exacerbated by the recent usage of the same endpoint by ricecooker to avoid doing file uploads via the Studio app server.
To resolve this, we should add cleanup of File objects to the garbage collection utilities.
Acceptance criteria:
Add a utility function for cleaning up files that have no associated ContentNodeAssessementItem or SlideShow - it is vital that only files for which these three are all null should be deleted.
Create tests to assert the above function correctly ignores File objects with non-null values for any of the above relations.
Enhance the function to allow specifying a last modified time range - so that we can selectively remove File objects that have not been modified in 1 month, 1 week etc.
Whenever the file upload URL endpoint is accessed, it creates an entry in the File table for that file. As this generally happens prior to the creation of a ContentNode or AssessmentItem associated with this file, if no ContentNode or AssessmentItem are created, then this can leave a File object that is not attached to any specific object.
This has been exacerbated by the recent usage of the same endpoint by ricecooker to avoid doing file uploads via the Studio app server.
To resolve this, we should add cleanup of File objects to the garbage collection utilities.
Acceptance criteria:
ContentNode
AssessementItem
orSlideShow
- it is vital that only files for which these three are allnull
should be deleted.The text was updated successfully, but these errors were encountered: