BaGet
BaGet copied to clipboard
[WIP] Added support for re-indexing all missing packages on startup.
What does this PR do?
Adds support for, on startup, to go through all packages in the store and re-adds them to the database.
Motivation
The intention is to have the option to treat the sqllite database living inside the container as a throwaway cache, since the container is rarely restarted and its one less connection to secure.
Additional Notes
Could use some more work, but I wanted some feedback on this feature and the general approach. One thing of note is that the downloads count for packages would be reset if the docker container is restarted (something we dont care about).
I like the idea of being able to use the SQLite database as a throwaway cache! I think we can kill two birds with one stone by implementing a "drop folder" with automatic indexing, similar to NuGet.Server's ServerPackageRepository (see https://github.com/loic-sharma/BaGet/issues/3). For your case, the "drop folder" would be the packages folder. Any unknown packages would automatically be indexed at startup. If you reset the database, all packages would automatically be reindexed. Does that seem like a reasonable solution?
Agree on all points. This turned out a bit rushed and was only meant as a workaround since I couldnt get a proper database to work. It should be replaced with a proper implementation for a drop folder, but thats not something I have time for now. Should I just close this or leave it open for someone else to build upon?
Let’s leave this open as it’s 80% the way there. I’ll finish this up in the future. Thanks for starting this work!
Is there any progress on this @Mizipzor @loic-sharma we are running Baget in kubernetes backed by S3. Every time a pod gets restarted we loose the metadata in the web UI. This would be a nice feature to have.
I'm afraid I had to abandon work on this due to time constraints. It's been left here in its current state for someone else to build upon, if it would save them time. I might return to it, should the opportunity presents itself.