Skip to content

[garbage-collector] Initial commit.#649

Merged
swashata merged 10 commits intodevelopfrom
feature/garbage-collector
Sep 26, 2023
Merged

[garbage-collector] Initial commit.#649
swashata merged 10 commits intodevelopfrom
feature/garbage-collector

Conversation

@fajardoleo
Copy link
Copy Markdown
Contributor

No description provided.

@fajardoleo fajardoleo self-assigned this Aug 9, 2023
…s also covers add-on–related use cases; properly store updated options and store them only once).
Copy link
Copy Markdown
Contributor

@swashata swashata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fajardoleo Thanks for the PR. I think I understand the logic, but I do believe the code can be made more organized. Please see my suggestion, thanks 👍

…ating large method(s) into multiple smaller methods.
Copy link
Copy Markdown
Contributor

@swashata swashata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fajardoleo Great job on the refactoring 👏 . Please see my few suggestions, I think we can simplify it/make it more readable. Thanks

Copy link
Copy Markdown
Contributor

@swashata swashata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fajardoleo Nice refactoring. You have managed to get rid of several if..else in the logic and the code is much more readable now. Please see my suggestion for some easy improvements. Thanks.

}

if ( ! $updated ) {
if ( isset( $option[ $slug ] ) ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question @fajardoleo : Are all these checks mutually exclusive? So when $option[ $slug ] is present we won't need to check for $option[ "{$slug}:{$this->get_type()}" ]?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swashata That is right.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fajardoleo looks like I get it now. If we ever go with my improvement suggestion (one GC class per option) we can get rid of this, but not important right now at the moment. I have added a @todo.

@fajardoleo fajardoleo force-pushed the feature/garbage-collector branch from 5be4d83 to b2c48da Compare September 20, 2023 08:07
…age collect.

1. Consider {product}_data when doing garbage collection.
2. Don't garbage collect all_{module} and active_{module} since those
   have different structure and source. Add @todo to implement them
   later.
3. Properly handle missing timestamp in the garbage collector, adding
   zero risk to the existing BL.
4. Disable garbage collection by default and add it behind a flag =>
   WP_FS__ENABLE_GARBAGE_COLLECTOR.
5. Simplify some logic where possible.
Copy link
Copy Markdown
Contributor

@swashata swashata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fajardoleo I implemented my suggestions and fixed the typos I found. Now please review my commit and test :D

}

if ( ! $updated ) {
if ( isset( $option[ $slug ] ) ) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fajardoleo looks like I get it now. If we ever go with my improvement suggestion (one GC class per option) we can get rid of this, but not important right now at the moment. I have added a @todo.

Copy link
Copy Markdown
Contributor

@swashata swashata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@swashata swashata merged commit bee173e into develop Sep 26, 2023
@swashata swashata deleted the feature/garbage-collector branch September 26, 2023 07:32
@swashata swashata linked an issue Oct 30, 2023 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Reduce fs_accounts option size, possible?

2 participants