private async Task CreateStageSettingsDocument()
 {
     //Create stage document if not exists
     if (await _connectionManager.IsDocumentEmptyAsync(_options.GetStageDocumentPath()))
     {
         _logger.LogDebug($"Creating {_options.StagesCollection} {_options.ReleaseStage}");
         await _connectionManager.SaveAsync(_options.GetStageDocumentPath(), new Dictionary <string, object>());
     }
 }
Beispiel #2
0
        public void CreateListeners(Func <ConfigurationLevels, string, Task> loadOnChangeAsyncCallback)
        {
            ConfigurationDocuments.Add(ConfigurationLevels.Application, FirestoreClient.Document(_options.GetApplicationDocumentPath()));
            ConfigurationDocuments.Add(ConfigurationLevels.Stage, FirestoreClient.Document(_options.GetStageDocumentPath()));
            ConfigurationDocuments.Add(ConfigurationLevels.Machine, FirestoreClient.Document(_options.GetMachineDocumentPath()));
            ConfigurationDocuments.Add(ConfigurationLevels.Tag, FirestoreClient.Document(_options.GetTagDocumentPath()));

            ConfigurationDocuments.ToList().ForEach(d =>
                                                    ConfigurationListeners.Add(d.Key, d.Value.Listen(async snapshot =>
            {
                await loadOnChangeAsyncCallback(d.Key, snapshot.Reference.Path);
            }))
                                                    );
        }