Merge branch 'heartbeat-frequency' into dev
This commit is contained in:
commit
ba9a716913
@ -1,6 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.shortcuts import reverse
|
from django.shortcuts import reverse
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
@ -57,7 +58,7 @@ class Session(models.Model):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_currently_active(self):
|
def is_currently_active(self):
|
||||||
return timezone.now() - self.last_seen < timezone.timedelta(seconds=10)
|
return timezone.now() - self.last_seen < timezone.timedelta(milliseconds=settings.SCRIPT_HEARTBEAT_FREQUENCY * 2)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def duration(self):
|
def duration(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user