create data folder
This commit is contained in:
@@ -31,7 +31,15 @@ func Ins() *IpDb {
|
||||
return ins
|
||||
}
|
||||
|
||||
func CleanTempFiles() error {
|
||||
func CleanupDataDir() error {
|
||||
if _, err := os.Stat(configs.GeoDbFolder); os.IsNotExist(err) {
|
||||
log.Info().Str("dir", configs.GeoDbFolder).Msg("Creating data folder")
|
||||
err := os.MkdirAll(configs.GeoDbFolder, os.ModePerm)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
log.Info().Str("dir", configs.GeoDbFolder).Msg("Cleaning temp files")
|
||||
dir, err := os.Open(configs.GeoDbFolder)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user