#62 - File locking problem in cache

This commit is contained in:
Luke Pulverenti
2013-04-02 22:59:27 -04:00
parent 713afcf675
commit fa884f3fea
16 changed files with 239 additions and 294 deletions

View File

@@ -300,10 +300,18 @@ namespace MediaBrowser.Server.Implementations.Library
var activityDate = DateTime.UtcNow;
var lastActivityDate = user.LastActivityDate;
user.LastActivityDate = activityDate;
LogConnection(user.Id, clientType, deviceId, deviceName, activityDate);
// Don't log in the db anymore frequently than 10 seconds
if (lastActivityDate.HasValue && (activityDate - lastActivityDate.Value).TotalSeconds < 10)
{
return Task.FromResult(true);
}
// Save this directly. No need to fire off all the events for this.
return Kernel.UserRepository.SaveUser(user, CancellationToken.None);
}