Skip to content

Commit dee99d6

Browse files
committed
Generate default timestamp within "track" function call. Otherwise the timestamp will be the same for all subsequent calls if no time-parameter ist given.
1 parent b33648a commit dee99d6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/analytics/input.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ def encode(props):
6767

6868
return encoded
6969

70-
def track(self, event_name, time = datetime.now().isoformat(), distinct_id = None, **props):
70+
def track(self, event_name, time = None, distinct_id = None, **props):
71+
if time is None:
72+
time = datetime.now().isoformat()
73+
7174
event = '%s %s="%s" %s="%s" ' % (
7275
time,
7376
APPLICATION_KEY, self.application_name,

0 commit comments

Comments
 (0)