Gert-dev / php-ide-serenata

Atom IDE package that integrates the Serenata server to provide PHP code assistance
https://serenata.gitlab.io/
Other
275 stars 19 forks source link

Clean up indices for non-existent project #215

Open adiachenko opened 8 years ago

adiachenko commented 8 years ago

I started using this package the other day and it's great. The one thing that is boggling my mind though is the lack of garbage collection for old databases. It would be great if php-integrator could detect changes in projects.cson and remove indices for projects that no longer exists or, alternatively, provide an option to clear them manually via a menu item like php-integrator-base:clear-nonexistent-projects. This along with #178 effectively leads to situation where I constantly keep ~/.atom/packages/php-integrator-base/indexes in Quick Access folders so I can monitor it's state manually. It's not a big deal, but it would still be nice to address this.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ghost commented 8 years ago

That sounds like a good idea that is now possible as project support indicates what PHP projects are present. In theory the package could simply prune the unnecessary databases on start-up.

machitgarha commented 3 years ago

@Gert-dev This one is so old, and it seems the way Serenata (and the package) works has been changed since. I could not find indexes file or so. As a result, this is not relevant and should be closed.

Gert-dev commented 3 years ago

I believe databases are still being placed in the user's cache folder by default, see also https://github.com/Gert-dev/php-ide-serenata/blob/master/lib/AtomConfig.js#L75. However, at least Windows 10 can prune these sorts of temporary files by default when disk space is low, so I'm not sure if it's still necessary for us to provide a mechanism to clean them up - even if we do, I wouldn't know what kind of behavior to put behind that; when is it safe to clean up an old database? Perhaps after it hasn't been used in a few months?

machitgarha commented 3 years ago

@Gert-dev So, I it seems I mis-understood something.

Not really sure about that, but I guess old databases are being pruned on my system (Feodra 34) everytime I make a reboot. The reason is, even when my existent project starts being indexed after a fresh boot, it takes just as if it is a new project (i.e. taking some time), but not when I re-open Atom without a reboot. So maybe you're right, it gets deleted automatically by the system.