Skip to content

Support remote sync policy#146

Merged
bhou-crto merged 3 commits intomainfrom
sync-policy
Jan 6, 2025
Merged

Support remote sync policy#146
bhou-crto merged 3 commits intomainfrom
sync-policy

Conversation

@bhou-crto
Copy link
Contributor

This feature allows developer to control the frequency of syncing with the remote repository

As a first step, developer needs to modify the configuration file manually to setup up the sync policy of the extra remote registry.
Ex.

{
            "name": "test",
            "remote_base_url": "https://url-to/test-registry",
            "repository_dir": "/Users/b.hou/.cdt/test",
            "sync_policy": "weekly"
}

By default, the sync_policy is set to 'always'. The possible values are:

  • always
  • never
  • hourly
  • daily
  • weekly
  • monthly

Updater will take the sync_policy into consideration before executing the update.

Note

the built-in update command cl update --package ignores the sync_policy, which "always" performs the update


Caveats and Follow-up

Follow up improves

  • check the sync_policy in the "preRun" phase, to improve the performance when there are too many remote registry.
  • extract the constants of the sync_policy and use it in different modules
  • provide command interface in the built-in remote command to change the sync policy

This PR closes #106

@bhou-crto bhou-crto assigned zeralight and unassigned zeralight Jan 2, 2025
@bhou-crto bhou-crto requested a review from zeralight January 2, 2025 14:50
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.

Support different sync policy for extra remotes

3 participants