BaGet icon indicating copy to clipboard operation
BaGet copied to clipboard

[WIP] Added support for re-indexing all missing packages on startup.

Open alexanderfast opened this issue 6 years ago • 5 comments
trafficstars

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).

alexanderfast avatar Dec 11 '18 11:12 alexanderfast

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?

loic-sharma avatar Dec 12 '18 08:12 loic-sharma

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?

alexanderfast avatar Dec 12 '18 13:12 alexanderfast

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!

loic-sharma avatar Dec 19 '18 07:12 loic-sharma

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.

rdubya16 avatar Aug 30 '19 12:08 rdubya16

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.

alexanderfast avatar Sep 23 '19 18:09 alexanderfast