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

WP CLI command for background synchronization #451

Closed
4 tasks done
antonkorotkov opened this issue Feb 26, 2020 · 7 comments
Closed
4 tasks done

WP CLI command for background synchronization #451

antonkorotkov opened this issue Feb 26, 2020 · 7 comments
Assignees
Milestone

Comments

@antonkorotkov
Copy link
Contributor

antonkorotkov commented Feb 26, 2020

Since we are going to clean up the current implementation if CLI #450, it may be a good point to start adding new features to it #447.

image

  • The new command (sync) should basically do the same as Sync processes do on the Settings -> Sync tab.
  • It should support the mode argument to control the Sync type (for images and non-images).
  • Should have an argument for Bulk Size.
  • Any other arguments that could be useful?
@planv planv mentioned this issue Mar 4, 2020
planv added a commit that referenced this issue Mar 4, 2020
@ewsopp ewsopp added this to the v2.4.0 milestone Mar 4, 2020
@planv planv linked a pull request Mar 5, 2020 that will close this issue
@planv planv removed a link to a pull request Mar 5, 2020
@ewsopp
Copy link
Member

ewsopp commented Mar 20, 2020

@alimuzzaman can you test this please?

@ewsopp ewsopp assigned alimuzzaman and unassigned planv Mar 20, 2020
@alimuzzaman
Copy link
Contributor

OK, testing.

alimuzzaman pushed a commit that referenced this issue Mar 20, 2020
@alimuzzaman
Copy link
Contributor

alimuzzaman commented Mar 20, 2020

I ran this command wp stateless sync files --force --url=https://test2.stateless.ci/ --b

@planv why did it ran ten batches for only 4 attachment?
The sync has been done at the last batch.
Is this expected?

wp stateless sync files --force --url=https://test2.stateless.ci/ --b
...
Launching external command 'wp stateless sync files --force --batch=1 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=2 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=3 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=4 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=5 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=6 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=7 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=8 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=9 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 0
Synced stateless for 0 attachments
Spent Time: 0 sec
...
Launching external command 'wp stateless sync files --force --batch=10 --batches=10 --limit=100 --url=https://test2.stateless.ci/'
Waiting...
Starting extract attachments.
Success: Stateless Media is synced
Media which have been checked: 4
Synced stateless for 3 attachments
Spent Time: 2 sec

@alimuzzaman
Copy link
Contributor

@ewsopp everything else is ok.

alimuzzaman pushed a commit that referenced this issue Mar 23, 2020
@planv
Copy link
Contributor

planv commented Mar 24, 2020

@alimuzzaman

why did it ran ten batches for only 4 attachment?
Ten batches - it is count batches by default.

изображение

The sync has been done at the last batch.
Is this expected?

Yes, because we use argument batch for calculating LIMIT on SQL query.

@planv
Copy link
Contributor

planv commented Mar 27, 2020

Added new sync option use_wildcards
#449 (comment)

@alimuzzaman
Copy link
Contributor

use_wildcards is working fine.

@ewsopp ewsopp removed this from the v2.4.0 milestone Jun 3, 2020
@ewsopp ewsopp added this to the v3.0.0 milestone Sep 9, 2020
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

4 participants