From cede129ede147c604ab20d5ca5bb1d1692525653 Mon Sep 17 00:00:00 2001 From: Peter Grlica Date: Thu, 10 Dec 2020 16:03:13 +0100 Subject: [PATCH] Updated example .env, added experimental warnings --- .env.example | 14 +++++++++++++- federation/service/service.go | 15 ++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 195f64464..697dfcb40 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/federation/service/service.go b/federation/service/service.go index a3ed589b0..67734e015 100644 --- a/federation/service/service.go +++ b/federation/service/service.go @@ -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) {