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

The problem of php mirror.php --gc command #7

Closed
peter279k opened this issue Nov 9, 2020 · 4 comments
Closed

The problem of php mirror.php --gc command #7

peter279k opened this issue Nov 9, 2020 · 4 comments

Comments

@peter279k
Copy link

After looking at this code snippet, it seems that this will remove the files are on p folder.

That is, it will clean the outdated Composer V1 mirror files.

What about the outdated Composer v2 mirror files? (These files will be on p2 folder) Are they need to be removed?

@peter279k
Copy link
Author

It seems that the outdated files about V2 will be removed during v2 mirror syncing.

If I don't run php mirror.php --v1 command to build the Composer V1 mirrors, I don't need to run php mirror.php --gc every hour?

@peter279k
Copy link
Author

I notice that following message snippets when the it doesn't have Composer v1 mirror:

Mirror  job failed at 2020-11-10 16:09:55
[ErrorException] file_get_contents(/var/www/html/public/p/provider-2013$c6f19599d6682dbdbd2c6b93faa2f2f53b8f1f64717ec199d944794833be9bdd.json.gz): failed to open stream: No such file or directory
PHP Fatal error:  Uncaught ErrorException: file_get_contents(/var/www/html/public/p/provider-2013$c6f19599d6682dbdbd2c6b93faa2f2f53b8f1f64717ec199d944794833be9bdd.json.gz): failed to open stream: No such file or directory in /var/www/html/mirror.php:498

It seems that the php mirror.php --gc command doesn't necessary to run if the Composer v1 mirrors are not on server.

@Seldaek
Copy link
Member

Seldaek commented Nov 11, 2020

Right, running the gc command is not needed if you only run --v2. I added this in the README now, and I'll make sure the gc command exits early if configured to only have v2.

@Seldaek
Copy link
Member

Seldaek commented Nov 11, 2020

And yes you are right, the v2 files get deleted/cleaned up as part of the regular v2 updates, v1 did not have an update feed so we could not clean up deleted files there.

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

2 participants