3
0

Updated example .env, added experimental warnings

This commit is contained in:
Peter Grlica 2020-12-10 16:03:13 +01:00
parent cab20207c6
commit cede129ede
2 changed files with 25 additions and 4 deletions

View File

@ -85,5 +85,17 @@ DB_DSN=corteza:corteza@tcp(localhost:3306)/corteza?collation=utf8mb4_general_ci
# When true, it does not create un-existing buckets
#MINIO_STRICT=false
# Federation feature
#######################################################################################################################
#
# Federation - warning, this is still an experimental feature
#
FEDERATION_ENABLED=false
FEDERATION_HOST=localhost:80
FEDERATION_LABEL=Federation host 1
# Sync settings - paging and sync delay
FEDERATION_SYNC_STRUCTURE_MONITOR_INTERVAL=2m
FEDERATION_SYNC_STRUCTURE_PAGE_SIZE=100
FEDERATION_SYNC_DATA_MONITOR_INTERVAL=60s
FEDERATION_SYNC_DATA_PAGE_SIZE=100

View File

@ -147,6 +147,8 @@ func Watchers(ctx context.Context) {
return
}
DefaultLogger.Info("Starting federation - warning, this is still an experimental feature")
syncService := NewSync(
&Syncer{},
&Mapper{},
@ -156,10 +158,17 @@ func Watchers(ctx context.Context) {
ss.DefaultRole)
syncStructure := WorkerStructure(syncService, DefaultLogger)
syncData := WorkerData(syncService, service.DefaultLogger)
syncData := WorkerData(syncService, DefaultLogger)
go syncStructure.Watch(ctx, time.Second*DefaultOptions.StructureMonitorInterval, DefaultOptions.StructurePageSize)
go syncData.Watch(ctx, time.Second*DefaultOptions.DataMonitorInterval, DefaultOptions.DataPageSize)
go syncStructure.Watch(
ctx,
time.Second*DefaultOptions.StructureMonitorInterval,
DefaultOptions.StructurePageSize)
go syncData.Watch(
ctx,
time.Second*DefaultOptions.DataMonitorInterval,
DefaultOptions.DataPageSize)
}
func AddFederationLabel(entity label.LabeledResource, value string) {