Fixing Lock File serialization on international systems

This commit is contained in:
Sebastien Ros
2014-07-29 14:33:21 -07:00
parent 9d3f5c2d20
commit 211ffaf647

View File

@@ -27,7 +27,7 @@ namespace Orchard.FileSystems.LockFile {
return false;
}
lockFile = new LockFile(_appDataFolder, path, _clock.UtcNow.ToString(CultureInfo.InvariantCulture), _rwLock);
lockFile = new LockFile(_appDataFolder, path, _clock.UtcNow.ToString("u"), _rwLock);
return true;
}
catch {
@@ -63,7 +63,7 @@ namespace Orchard.FileSystems.LockFile {
// if expired the file is not removed
// it should be automatically as there is a finalizer in LockFile
// or the next taker can do it, unless it also fails, again
return creationUtc.Add(Expiration) > _clock.UtcNow;
return creationUtc.ToUniversalTime().Add(Expiration) > _clock.UtcNow;
}
}