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

feat: Add GeoAutoUpdate and GeoUpdateInterval to config #857

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

Kuingsmile
Copy link

  1. Introduction of geo-auto-update and geo-update-interval Configuration Items

geo-auto-update : This flag controls the automatic updating of the geo data file. It is set to false by default, ensuring that auto-updates are opt-in rather than automatic.

geo-update-interval : This parameter defines the interval (in hours) for the geo data file auto-update process. The default value is set to 24 hours, providing a daily update cycle when geo-auto-update is enabled.

  1. Bug Fix: Accurate Error Handling in saveFile Function

The original code did not correctly capture and relay errors encountered during the file saving process.

Previous Implementation:

data, err := downloadForBytes(ExternalUIURL)
if err != nil {
	return fmt.Errorf("can't download  file: %w", err)
}

saved := path.Join(C.Path.HomeDir(), "download.zip")
// this place
if saveFile(data, saved) != nil {
	return fmt.Errorf("can't save zip file: %w", err)
}
defer os.Remove(saved)

Revised Implementation:

data, err := downloadForBytes(ExternalUIURL)
if err != nil {
	return fmt.Errorf("can't download  file: %w", err)
}

saved := path.Join(C.Path.HomeDir(), "download.zip")
// fixed
if err = saveFile(data, saved); err != nil {
	return fmt.Errorf("can't save zip file: %w", err)
}
defer os.Remove(saved)

@Larvan2 Larvan2 merged commit 3a10bbc into MetaCubeX:Alpha Dec 3, 2023
@Larvan2
Copy link
Collaborator

Larvan2 commented Dec 3, 2023

thanks for PR

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