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

Buffered save #324

Draft
wants to merge 2 commits into
base: fix-chat-switch-streaming-cancel
Choose a base branch
from
Draft

Conversation

noxware
Copy link
Collaborator

@noxware noxware commented Dec 6, 2024

No description provided.

@@ -80,3 +85,37 @@ pub fn write_to_file(path: PathBuf, json: &str) -> Result<(), std::io::Error> {
file.write_all(json.as_bytes())?;
Ok(())
}

static BUFFERED_WRITER: LazyLock<Sender<(PathBuf, String)>> = LazyLock::new(|| {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

LazyLock is supported in Rust stable since 1.80. Seems like the build CI is using an older Rust version?

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.

1 participant