|
@@ -55,8 +55,9 @@ type AppInitConfig struct {
|
|
|
Table string `mapstructure:"table"`
|
|
|
} `mapstructure:"stck"`
|
|
|
Main struct {
|
|
|
- UploadRetryMaxTimes int `mapstructure:"uploadRetryMaxTimes"`
|
|
|
- FailedRetryDelaySeconds int `mapstructure:"failedRetryDelaySeconds"`
|
|
|
+ UploadRetryMaxTimes int `mapstructure:"uploadRetryMaxTimes"`
|
|
|
+ FailedRetryDelaySeconds int `mapstructure:"failedRetryDelaySeconds"`
|
|
|
+ NotifyToUploadDelaySeconds int `mapstructure:"notifyToUploadDelaySeconds"`
|
|
|
} `mapstructure:"main"`
|
|
|
}
|
|
|
|
|
@@ -106,6 +107,7 @@ var appInitCfg *AppInitConfig = &AppInitConfig{}
|
|
|
func initLoadConfig() {
|
|
|
viper.SetDefault("main.uploadRetryMaxTimes", 20)
|
|
|
viper.SetDefault("main.failedRetryDelaySeconds", 5)
|
|
|
+ viper.SetDefault("main.notifyToUploadDelaySeconds", 1)
|
|
|
viper.SetConfigFile("./config/application.yaml")
|
|
|
viper.WatchConfig()
|
|
|
viper.OnConfigChange(func(e fsnotify.Event) {
|
|
@@ -378,7 +380,7 @@ func main_worker(app AppCtx, objUploadChan *util.DChan[string]) {
|
|
|
delete(objFailCounter, key)
|
|
|
mutexObjFailCounter.Unlock()
|
|
|
// Queue the object for upload
|
|
|
- objUploadChan.DelayedWrite(key, 1*time.Second)
|
|
|
+ objUploadChan.DelayedWrite(key, time.Duration(appInitCfg.Main.NotifyToUploadDelaySeconds)*time.Second)
|
|
|
}
|
|
|
if notifyInfo.Err != nil {
|
|
|
logger.Errorf("Bucket notification listener error: %v", notifyInfo.Err)
|