Skip to content

fix: update file writing#932

Merged
rpkelly merged 2 commits into
awslabs:developfrom
sky1122:file-write
Apr 24, 2026
Merged

fix: update file writing#932
rpkelly merged 2 commits into
awslabs:developfrom
sky1122:file-write

Conversation

@sky1122

@sky1122 sky1122 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Description of changes:
update file writing

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment thread tough/src/editor/signed.rs Outdated
.context(error::FileWriteSnafu { path })
let buf = self.buffer.clone();

tokio::task::spawn_blocking(move || {

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.

Can we try to use tokio::io::write_all and remove spawn_blocking

Comment thread tough/src/cache.rs Outdated
file.flush()
.await
.context(error::CacheFileWriteSnafu { path: outpath })
tokio::task::spawn_blocking(move || {

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.

Here too

let mut file = tokio::fs::File::create(&path)
.await
.context(error::FileWriteSnafu { path: &path })?;
file.write_all(&self.buffer)

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.

nit: i'd prefer we add a file.flush().await

@sky1122 sky1122 changed the title refactor fix: update file writing Apr 23, 2026
Signed-off-by: Jingwei Wang <jweiw@amazon.com>
Signed-off-by: Jingwei Wang <jweiw@amazon.com>
@rpkelly rpkelly merged commit 1243958 into awslabs:develop Apr 24, 2026
9 checks passed
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.

4 participants