Skip to content

Commit

Permalink
fix:修复存量配置兼容问题 (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored May 5, 2023
1 parent ea547f9 commit 04712bb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
4 changes: 3 additions & 1 deletion admin/job/clean_deleted_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ type cleanDeletedClientsJob struct {
}

func (job *cleanDeletedClientsJob) init(raw map[string]interface{}) error {
cfg := &CleanDeletedClientsJobConfig{}
cfg := &CleanDeletedClientsJobConfig{
ClientCleanTimeout: 10 * time.Minute,
}
decodeConfig := &mapstructure.DecoderConfig{
DecodeHook: mapstructure.StringToTimeDurationHookFunc(),
Result: cfg,
Expand Down
4 changes: 3 additions & 1 deletion admin/job/clean_deleted_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ type cleanDeletedInstancesJob struct {
}

func (job *cleanDeletedInstancesJob) init(raw map[string]interface{}) error {
cfg := &CleanDeletedInstancesJobConfig{}
cfg := &CleanDeletedInstancesJobConfig{
InstanceCleanTimeout: 10 * time.Minute,
}
decodeConfig := &mapstructure.DecoderConfig{
DecodeHook: mapstructure.StringToTimeDurationHookFunc(),
Result: cfg,
Expand Down
8 changes: 3 additions & 5 deletions admin/job/delete_empty_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ type deleteEmptyAutoCreatedServiceJob struct {
}

func (job *deleteEmptyAutoCreatedServiceJob) init(raw map[string]interface{}) error {
cfg := &DeleteEmptyAutoCreatedServiceJobConfig{}
cfg := &DeleteEmptyAutoCreatedServiceJobConfig{
ServiceDeleteTimeout: 30 * time.Minute,
}
decodeConfig := &mapstructure.DecoderConfig{
DecodeHook: mapstructure.StringToTimeDurationHookFunc(),
Result: cfg,
Expand Down Expand Up @@ -90,10 +92,6 @@ func (job *deleteEmptyAutoCreatedServiceJob) getAllEmptyAutoCreatedServices() []
if svc.IsAlias() {
return true, nil
}
v, ok := svc.Meta[service.MetadataInternalAutoCreated]
if !ok || v != "true" {
return true, nil
}
count := job.cacheMgn.Instance().GetInstancesCountByServiceID(svc.ID)
if count.TotalInstanceCount == 0 {
res = append(res, svc)
Expand Down
4 changes: 3 additions & 1 deletion admin/job/delete_unhealthy_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ type deleteUnHealthyInstanceJob struct {
}

func (job *deleteUnHealthyInstanceJob) init(raw map[string]interface{}) error {
cfg := &DeleteUnHealthyInstanceJobConfig{}
cfg := &DeleteUnHealthyInstanceJobConfig{
InstanceDeleteTimeout: 60 * time.Minute,
}
decodeConfig := &mapstructure.DecoderConfig{
DecodeHook: mapstructure.StringToTimeDurationHookFunc(),
Result: cfg,
Expand Down
4 changes: 2 additions & 2 deletions release/conf/polaris-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ maintain:
enable: true
option:
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
instanceCleanTimeout: 10m
# instanceCleanTimeout: 10m
# Clean soft deleted clients
- name: CleanDeletedClients
enable: true
option:
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
clientCleanTimeout: 10m
# clientCleanTimeout: 10m

# Storage configuration
store:
Expand Down

0 comments on commit 04712bb

Please sign in to comment.