Disable updating ApproxLastUsed on profiles
This commit is contained in:
@@ -291,13 +291,24 @@ func (profile *Profile) LastActive() int64 {
|
|||||||
|
|
||||||
// MarkUsed updates ApproxLastUsed when it's been a while and saves the profile if it was changed.
|
// MarkUsed updates ApproxLastUsed when it's been a while and saves the profile if it was changed.
|
||||||
func (profile *Profile) MarkUsed() (changed bool) {
|
func (profile *Profile) MarkUsed() (changed bool) {
|
||||||
profile.Lock()
|
/*
|
||||||
defer profile.Unlock()
|
TODO:
|
||||||
|
This might be one of the things causing problems with disappearing settings.
|
||||||
|
Possibly this is called with an outdated profile and then kills settings
|
||||||
|
already in the database.
|
||||||
|
Generally, it probably causes more harm than good if we periodically touch
|
||||||
|
the most important database entries just to update a timestamp.
|
||||||
|
We should save this data elsewhere and make configuration data as stable as
|
||||||
|
possible.
|
||||||
|
|
||||||
if time.Now().Add(-lastUsedUpdateThreshold).Unix() > profile.ApproxLastUsed {
|
profile.Lock()
|
||||||
profile.ApproxLastUsed = time.Now().Unix()
|
defer profile.Unlock()
|
||||||
return true
|
|
||||||
}
|
if time.Now().Add(-lastUsedUpdateThreshold).Unix() > profile.ApproxLastUsed {
|
||||||
|
profile.ApproxLastUsed = time.Now().Unix()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user