This commit is contained in:
@@ -72,7 +72,7 @@ namespace AyaNova
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Unable to locate or create server file folders error was: {ex.Message}");
|
||||
Console.WriteLine($"Unable to locate or create server file folders error was: {ex.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -232,8 +232,26 @@ namespace AyaNova
|
||||
|
||||
|
||||
//Log environmental settings
|
||||
var UtilityFilesAvailableSpace = FileUtil.BackupFilesDriveAvailableSpace();
|
||||
var AttachmentFilesAvailableSpace = FileUtil.AttachmentFilesDriveAvailableSpace();
|
||||
long UtilityFilesAvailableSpace = 0;
|
||||
try
|
||||
{
|
||||
UtilityFilesAvailableSpace = FileUtil.BackupFilesDriveAvailableSpace();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex, "FileUtil::UtilityFilesDriveAvailableSpace error getting available space");
|
||||
}
|
||||
|
||||
long AttachmentFilesAvailableSpace = 0;
|
||||
try
|
||||
{
|
||||
AttachmentFilesAvailableSpace = FileUtil.AttachmentFilesDriveAvailableSpace();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex, "FileUtil::AttachmentFilesDriveAvailableSpace error getting available space");
|
||||
}
|
||||
|
||||
|
||||
logger.Info("OS - {0}", Environment.OSVersion.ToString());
|
||||
logger.Info("TimeZone - {0}", TimeZoneInfo.Local.DisplayName);
|
||||
|
||||
@@ -104,8 +104,25 @@ namespace AyaNova.Biz
|
||||
var AttachmentFilesInfo = FileUtil.GetAttachmentFolderSizeInfo();
|
||||
|
||||
//Available space
|
||||
var UtilityFilesAvailableSpace = FileUtil.BackupFilesDriveAvailableSpace();
|
||||
var AttachmentFilesAvailableSpace = FileUtil.AttachmentFilesDriveAvailableSpace();
|
||||
long UtilityFilesAvailableSpace = 0;
|
||||
try
|
||||
{
|
||||
UtilityFilesAvailableSpace = FileUtil.BackupFilesDriveAvailableSpace();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.LogError(ex, "FileUtil::UtilityFilesDriveAvailableSpace error getting available space");
|
||||
}
|
||||
|
||||
long AttachmentFilesAvailableSpace = 0;
|
||||
try
|
||||
{
|
||||
AttachmentFilesAvailableSpace = FileUtil.AttachmentFilesDriveAvailableSpace();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.LogError(ex, "FileUtil::AttachmentFilesDriveAvailableSpace error getting available space");
|
||||
}
|
||||
|
||||
using (AyContext ct = ServiceProviderProvider.DBContext)
|
||||
{
|
||||
|
||||
@@ -348,17 +348,9 @@ namespace AyaNova.Util
|
||||
|
||||
internal static long BackupFilesDriveAvailableSpace()
|
||||
{
|
||||
try
|
||||
{
|
||||
return new System.IO.DriveInfo(Path.GetPathRoot(BackupFilesFolder)).AvailableFreeSpace;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FileUtil::UtilityFilesDriveAvailableSpace");
|
||||
log.LogError(ex, "FileUtil::UtilityFilesDriveAvailableSpace error getting available space");
|
||||
return 0;
|
||||
}
|
||||
return new System.IO.DriveInfo(Path.GetPathRoot(BackupFilesFolder)).AvailableFreeSpace;
|
||||
|
||||
}
|
||||
|
||||
#endregion Utility file handling
|
||||
@@ -594,17 +586,7 @@ namespace AyaNova.Util
|
||||
|
||||
internal static long AttachmentFilesDriveAvailableSpace()
|
||||
{
|
||||
try
|
||||
{
|
||||
return new System.IO.DriveInfo(Path.GetPathRoot(AttachmentFilesFolder)).AvailableFreeSpace;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("FileUtil::AttachmentFilesDriveAvailableSpace");
|
||||
log.LogError(ex, "FileUtil::AttachmentFilesDriveAvailableSpace error getting available space");
|
||||
return 0;
|
||||
}
|
||||
return new System.IO.DriveInfo(Path.GetPathRoot(AttachmentFilesFolder)).AvailableFreeSpace;
|
||||
}
|
||||
|
||||
internal static IEnumerable<string> GetAllAttachmentFilePaths()
|
||||
@@ -822,8 +804,10 @@ namespace AyaNova.Util
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static string StringPathDecodeEnvironmentVariables(string path){
|
||||
if(string.IsNullOrWhiteSpace(path)){
|
||||
public static string StringPathDecodeEnvironmentVariables(string path)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user