Skip to content

refactor(Project): abort previous saveToCloud before starting a new one#836

Merged
nighca merged 1 commit intogoplus:devfrom
aofei:issue-796
Sep 2, 2024
Merged

refactor(Project): abort previous saveToCloud before starting a new one#836
nighca merged 1 commit intogoplus:devfrom
aofei:issue-796

Conversation

@aofei
Copy link
Member

@aofei aofei commented Aug 30, 2024

This also improves the auto-save mechanism by making it reactive to the saveToCloud process.

Fixes #796

this.addDisposer(retryAutoSave.cancel)

this.addDisposer(
watch(
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里的意图我没太理解,在 isSavingToCloud 变为 true(应该意味着 saveToCloud 开始执行)的时候立即执行一次 retryAutoSave / save

Copy link
Member Author

Choose a reason for hiding this comment

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

isSavingToCloud 变为 true(应该意味着 saveToCloud 开始执行)的时候立即执行一次 retryAutoSave / save

是的。这里的目的是,当主动保存发生时,让 autoSaveToCloudStateFailed/Pending 立即进入到 Saving

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK,建议这里加个注释?

Copy link
Member Author

Choose a reason for hiding this comment

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

… one

This also improves the auto-save mechanism by making it reactive to the
`saveToCloud` process.

Fixes goplus#796

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@qiniu-ci
Copy link

qiniu-ci commented Sep 2, 2024

The PR environment is ready, please check the PR environment

[Attention]: This environment will be automatically cleaned up after a certain period of time., please make sure to test it in time. If you have any questions, please contact the builder team.

@nighca nighca merged commit 6254ef2 into goplus:dev Sep 2, 2024
@aofei aofei deleted the issue-796 branch September 2, 2024 12:21
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.

Race condition in Project.saveToCloud

3 participants