mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-18 16:41:36 -07:00
Fix race condition with duplicate instances
turns out it happens so quickly that not even having a file existence check right before opening it is sufficient enough
This commit is contained in:
parent
e1013bf9b1
commit
e0fcbaab2f
@ -36,7 +36,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
_filestream = File.Open(location, FileMode.Create, FileAccess.Write, FileShare.Read);
|
||||
try
|
||||
{
|
||||
_filestream = File.Open(location, FileMode.Create, FileAccess.Write, FileShare.Read);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
WriteLine(LOG_IDENT, "Failed to initialize because log file already exists");
|
||||
}
|
||||
|
||||
|
||||
Initialized = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user