コード例 #1
0
 /// <summary>
 /// Delete a function and all it's artifacts.
 /// </summary>
 /// <param name="function">Function to be deleted</param>
 /// <returns>(success, errorMessage)</returns>
 public (bool, string) TryDeleteFunction(FunctionMetadataResponse function)
 {
     try
     {
         FileUtility.DeleteDirectoryContentsSafe(function.GetFunctionPath(_config));
         DeleteFunctionArtifacts(function);
         return(true, string.Empty);
     }
     catch (Exception e)
     {
         return(false, e.ToString());
     }
 }
コード例 #2
0
        /// <summary>
        /// Delete a function and all it's artifacts.
        /// </summary>
        /// <param name="function">Function to be deleted</param>
        /// <returns>(success, errorMessage)</returns>
        public (bool, string) TryDeleteFunction(FunctionMetadataResponse function)
        {
            try
            {
                var functionPath = function.GetFunctionPath(_hostOptions);
                if (!string.IsNullOrEmpty(functionPath))
                {
                    FileUtility.DeleteDirectoryContentsSafe(functionPath);
                }

                DeleteFunctionArtifacts(function);
                return(true, string.Empty);
            }
            catch (Exception e)
            {
                return(false, e.ToString());
            }
        }
コード例 #3
0
        /// <summary>
        /// Delete a function and all it's artifacts.
        /// </summary>
        /// <param name="function">Function to be deleted</param>
        /// <returns>(success, errorMessage)</returns>
        public (bool, string) TryDeleteFunction(FunctionMetadataResponse function)
        {
            try
            {
                var hostOptions  = _applicationHostOptions.CurrentValue.ToHostOptions();
                var functionPath = function.GetFunctionPath(hostOptions);
                if (!string.IsNullOrEmpty(functionPath))
                {
                    FileUtility.DeleteDirectoryContentsSafe(functionPath);
                }

                DeleteFunctionArtifacts(function);

                _functionsSyncManager.TrySyncTriggersAsync();

                return(true, string.Empty);
            }
            catch (Exception e)
            {
                return(false, e.ToString());
            }
        }