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

Clean up Cocoapod cache after each build #344

Open
britzl opened this issue Feb 6, 2024 · 3 comments
Open

Clean up Cocoapod cache after each build #344

britzl opened this issue Feb 6, 2024 · 3 comments

Comments

@britzl
Copy link
Contributor

britzl commented Feb 6, 2024

The pod cache can grow quickly if the server gets a lot of build requests for a variety of extensions. Having a cronjob will not guarantee that we don't run out of disk. I propose that the CocoapodService.java will prune or wipe the cache after every build.

@ekharkunov
Copy link
Contributor

Several ideas:

  1. Schedule job in CocoapodsService to clean cache via command
pod cache clean --all

During cleanup all build request waits while operation is ended.
2. Cleanup pod used during the build

pod cache clean <name>

Can be problem when pod used in other build that currently running.

Personally I'd like variant 1.

Another suggestion. Make cocoapods repo update also as scheduled job that runs every hour (for example). And remove --repo-update flag from pod install command. It helps avoid errors when pod tries update repo in concurrent manner. As drawback - if user wants to user the "freshest" version of dependency - job can fail because version won't be in cache yet. I think in our case it's an acceptable drawback because user uses dependencies with pinned version and check is new version build or not before going production.

@britzl
Copy link
Contributor Author

britzl commented Oct 16, 2024

Personally I'd like variant 1.

I agree. This is probably the best way.

Make cocoapods repo update also as scheduled job that runs every hour (for example). And remove --repo-update flag from pod install command

Nice idea!

@AGulev
Copy link
Contributor

AGulev commented Oct 16, 2024

Maybe as the future step: it would be nice if Cron job check size (bigger or not of some limit we set) and clean only if condition met

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

No branches or pull requests

3 participants