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

Allow the tempdir used for working with c1zs to be configurable. #77

Merged
merged 7 commits into from
Oct 18, 2023

Conversation

jirwin
Copy link
Contributor

@jirwin jirwin commented Oct 14, 2023

The default OS tempdir might not be in the place that we'd prefer it to be. Instead of asking users to change the default path systemwide, allow users to configure it while using the SDK.

  • Adds a new c1z-temp-dir cli flag to any SDK connectors
  • Flows that through to c1z managers and the syncer.

Also fixes a bug where failed syncs(local, not service mode) were not properly writing c1zs back to the original file. This enables syncs to be resumed properly.

@jirwin jirwin force-pushed the jirwin/better-tmpdir-support branch from ebbf4c8 to d732859 Compare October 14, 2023 08:23
}

// Returns a C1File instance for the given db filepath.
func NewC1File(ctx context.Context, dbFilePath string) (*C1File, error) {
func NewC1File(ctx context.Context, dbFilePath string, opts ...C1FOption) (*C1File, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

style nit: not sure why this can't just be New() instead of NewC1File?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This package also contains NewC1ZFile(), so I think it was to disambiguate. We could probably move the details of that function into an option for this function. Will consider that in a separate PR since it'd be API breaking.

@jirwin jirwin merged commit 04a8343 into main Oct 18, 2023
@jirwin jirwin deleted the jirwin/better-tmpdir-support branch October 18, 2023 17:31
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.

2 participants