Descriptions on options, structure sync with superuser context
This commit is contained in:
@@ -2,7 +2,6 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
cs "github.com/cortezaproject/corteza-server/compose/service"
|
||||
"github.com/cortezaproject/corteza-server/federation/service"
|
||||
@@ -21,6 +20,6 @@ func commandSyncData(ctx context.Context) func(*cobra.Command, []string) {
|
||||
ss.DefaultRole)
|
||||
|
||||
syncData := service.WorkerData(syncService, service.DefaultLogger)
|
||||
syncData.Watch(ctx, time.Second*30, 50)
|
||||
syncData.Watch(ctx, service.DefaultOptions.DataMonitorInterval, service.DefaultOptions.DataPageSize)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package commands
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
cs "github.com/cortezaproject/corteza-server/compose/service"
|
||||
"github.com/cortezaproject/corteza-server/federation/service"
|
||||
@@ -21,6 +20,6 @@ func commandSyncStructure(ctx context.Context) func(*cobra.Command, []string) {
|
||||
ss.DefaultRole)
|
||||
|
||||
syncStructure := service.WorkerStructure(syncService, service.DefaultLogger)
|
||||
syncStructure.Watch(ctx, time.Second*service.DefaultOptions.StructureMonitorInterval, service.DefaultOptions.StructurePageSize)
|
||||
syncStructure.Watch(ctx, service.DefaultOptions.StructureMonitorInterval, service.DefaultOptions.StructurePageSize)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,7 @@ func (dp *structureProcesser) Process(ctx context.Context, payload []byte) (Proc
|
||||
}, nil
|
||||
}
|
||||
|
||||
// get the user that is tied to this node
|
||||
ctx = auth.SetIdentityToContext(ctx, dp.User)
|
||||
ctx = auth.SetSuperUserContext(ctx)
|
||||
|
||||
for _, em := range o {
|
||||
new := &types.SharedModule{
|
||||
|
||||
@@ -26,7 +26,15 @@ type (
|
||||
|
||||
// Federation initializes and returns a FederationOpt with default values
|
||||
func Federation() (o *FederationOpt) {
|
||||
o = &FederationOpt{}
|
||||
o = &FederationOpt{
|
||||
Enabled: false,
|
||||
Label: "Federation label",
|
||||
Host: "Federation host",
|
||||
StructureMonitorInterval: time.Minute * 2,
|
||||
StructurePageSize: 1,
|
||||
DataMonitorInterval: time.Second * 60,
|
||||
DataPageSize: 100,
|
||||
}
|
||||
|
||||
fill(o)
|
||||
|
||||
|
||||
@@ -6,28 +6,42 @@ imports:
|
||||
props:
|
||||
- name: Enabled
|
||||
type: bool
|
||||
default: false
|
||||
env: FEDERATION_ENABLED
|
||||
description: Federation enabled on system, it toggles rest API endpoints, possibility to map modules in Compose and sync itself
|
||||
|
||||
- name: Label
|
||||
type: string
|
||||
default: "Federation label"
|
||||
env: FEDERATION_LABEL
|
||||
description: Federation label
|
||||
|
||||
- name: Host
|
||||
type: string
|
||||
default: "Federation host"
|
||||
env: FEDERATION_HOST
|
||||
description: Host that is used during node pairing, also included in invitation
|
||||
|
||||
- name: StructureMonitorInterval
|
||||
type: time.Duration
|
||||
default: time.Minute * 2
|
||||
env: FEDERATION_SYNC_STRUCTURE_MONITOR_INTERVAL
|
||||
description: Delay in seconds for structure sync
|
||||
|
||||
- name: StructurePageSize
|
||||
type: int
|
||||
default: 1
|
||||
env: FEDERATION_SYNC_STRUCTURE_PAGE_SIZE
|
||||
description: Bulk size in fetching for structure sync
|
||||
|
||||
- name: DataMonitorInterval
|
||||
type: time.Duration
|
||||
default: time.Second * 60
|
||||
env: FEDERATION_SYNC_DATA_MONITOR_INTERVAL
|
||||
description: Delay in seconds for data sync
|
||||
|
||||
- name: DataPageSize
|
||||
type: int
|
||||
default: 100
|
||||
env: FEDERATION_SYNC_DATA_PAGE_SIZE
|
||||
description: Bulk size in fetching for data sync
|
||||
|
||||
Reference in New Issue
Block a user