Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto deleting books #71

Closed
rgaudin opened this issue Apr 15, 2022 · 5 comments · Fixed by #84
Closed

Auto deleting books #71

rgaudin opened this issue Apr 15, 2022 · 5 comments · Fixed by #84
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rgaudin
Copy link
Member

rgaudin commented Apr 15, 2022

Books are created via a Zimfarm call.

At that moment, ZIMs are probably online or about to be.
We add them to the Title (or create it if it's the first) and that's it.

Over time, we end end with many books for a Title.

We know that we are currently keeping at most 2 dates ZIM files per content on the server so if we have 3 books for a Title in the DB, chances are one of them is not reachable.

We should write down two things IMO:

  • what do we do now about this? I suggest we run a periodic script that checks titles with more than 2 books, check if the file is still online (HEAD) and delete the Book if not. We may want to check all the books to unsure we don't expose a dead book but that seems overkill until we use the generated XML file.
  • describe what we would ideally want. We've discussed we'd like the CMS to trigger the deletion of expired files but we haven't defined what an expired file is. I suppose this might depend on inclusion of not in one of the libraries…
@rgaudin rgaudin added the question Further information is requested label Apr 15, 2022
@rgaudin rgaudin self-assigned this Apr 15, 2022
@kelson42
Copy link
Contributor

@rgaudin The CMS should delete the books, whatever for which reasons. We should not have any other logic, anywhere else about book deletion IMO.

@rgaudin
Copy link
Member Author

rgaudin commented Apr 15, 2022

Agrees but:

  • we're not there yet and we'll need to delete books if we want to play with the generated library. I guess we'll do what I suggested in the interval should we not implement deletion first.
  • Doesn't answers the question of when a book is considered expired : when it should be deleted. Doesn't need to be decided now but it's an important decision for M2.

@kelson42
Copy link
Contributor

kelson42 commented Apr 15, 2022

  • we're not there yet and we'll need to delete books if we want to play with the generated library. I guess we'll do what I suggested in the interval should we not implement deletion first.

In the meantime, we should probably keep continuing to delete books like we do today. On the CMS side, I'm anyway in favour of having a periodic check if ZIM files are still online. If the file is in a library but not available anymore, then it should trigger an alarm, otherwise I guess it could be removed from the DB silently.

  • Doesn't answers the question of when a book is considered expired : when it should be deleted. Doesn't need to be decided now but it's an important decision for M2.

The current logic is appropriate IMO for the moment, I would keep it. Otherwise, we could maybe trigger a deletion in N days, each time a ZIM file leaves the library. Probably we will have to hardcode a few deprecation approaches and make them available to choose at the "title" level.

See also #7 for ondemand deletions.

@rgaudin
Copy link
Member Author

rgaudin commented Apr 15, 2022

OK 👍

@rgaudin rgaudin added this to the M2 milestone May 18, 2022
@rgaudin rgaudin changed the title How do we phase out books? Auto deleting books May 23, 2022
@rgaudin rgaudin added enhancement New feature or request and removed question Further information is requested labels May 23, 2022
@rgaudin
Copy link
Member Author

rgaudin commented May 23, 2022

Turning this into an actionable task for M2, we only want to remove the N previous versions of the book, when we receive and record a new one.

That number would be a constant and we could start with 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants