mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-11 08:52:58 +00:00
mod_managed: not crash when cannot remove shadow directory (this sometimes happens when restarting from FS console)
This commit is contained in:
parent
7c0cf506d8
commit
f3d089a998
@ -64,13 +64,23 @@ namespace FreeSWITCH {
|
|||||||
public static bool Load() {
|
public static bool Load() {
|
||||||
managedDir = Path.Combine(Native.freeswitch.SWITCH_GLOBAL_dirs.mod_dir, "managed");
|
managedDir = Path.Combine(Native.freeswitch.SWITCH_GLOBAL_dirs.mod_dir, "managed");
|
||||||
shadowDir = Path.Combine(managedDir, "shadow");
|
shadowDir = Path.Combine(managedDir, "shadow");
|
||||||
if (Directory.Exists(shadowDir)) {
|
if (Directory.Exists(shadowDir))
|
||||||
Directory.Delete(shadowDir, true);
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Directory.Delete(shadowDir, true);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteLine(LogLevel.Warning, "Cannot delete shadow directory: {0}", ex);
|
||||||
|
}
|
||||||
|
|
||||||
Directory.CreateDirectory(shadowDir);
|
Directory.CreateDirectory(shadowDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.WriteLine(LogLevel.Debug, "FreeSWITCH.Managed loader is starting with directory '{0}'.", managedDir);
|
Log.WriteLine(LogLevel.Debug, "FreeSWITCH.Managed loader is starting with directory '{0}'.", managedDir);
|
||||||
if (!Directory.Exists(managedDir)) {
|
if (!Directory.Exists(managedDir))
|
||||||
|
{
|
||||||
Log.WriteLine(LogLevel.Error, "Managed directory not found: {0}", managedDir);
|
Log.WriteLine(LogLevel.Error, "Managed directory not found: {0}", managedDir);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user