Пример #1
0
 private void OnSecretsChanged(object sender, SecretsChangedEventArgs e)
 {
     // clear the cached secrets if they exist
     // they'll be reloaded on demand next time
     if (e.SecretsType == ScriptSecretsType.Host)
     {
         _hostSecrets = null;
     }
     else
     {
         Dictionary <string, string> secrets;
         _secretsMap.TryRemove(e.Name, out secrets);
     }
 }
        private void OnChanged(object sender, FileSystemEventArgs e)
        {
            var changeHandler = SecretsChanged;

            if (changeHandler != null)
            {
                var args = new SecretsChangedEventArgs {
                    SecretsType = ScriptSecretsType.Host
                };

                if (string.Compare(Path.GetFileName(e.FullPath), ScriptConstants.HostMetadataFileName, StringComparison.OrdinalIgnoreCase) != 0)
                {
                    args.SecretsType = ScriptSecretsType.Function;
                    args.Name        = Path.GetFileNameWithoutExtension(e.FullPath).ToLowerInvariant();
                }

                changeHandler(this, args);
            }
        }
Пример #3
0
 private void OnSecretsChanged(object sender, SecretsChangedEventArgs e)
 {
     // clear the cached secrets if they exist
     // they'll be reloaded on demand next time
     if (e.SecretsType == ScriptSecretsType.Host)
     {
         _hostSecrets = null;
     }
     else
     {
         if (string.IsNullOrEmpty(e.Name))
         {
             _secretsMap.Clear();
         }
         else
         {
             _secretsMap.TryRemove(e.Name, out _);
         }
     }
 }
 private void OnSecretsChanged(object sender, SecretsChangedEventArgs e)
 {
     ClearCacheOnChange(e.SecretsType, e.Name);
 }
Пример #5
0
 private void BlobStorageSecretsMigrationRepository_SecretsChanged(object sender, SecretsChangedEventArgs e)
 {
     SecretsChanged?.Invoke(this, e);
 }