From ee9c51448d284f146ab88ad65d14481b570656b9 Mon Sep 17 00:00:00 2001 From: mr64bit Date: Wed, 14 Mar 2018 21:33:20 -0400 Subject: [PATCH] TIL default args in python don't eval each method call. --- lib/common/agents.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/common/agents.py b/lib/common/agents.py index 2f26c6c..58d0bdc 100644 --- a/lib/common/agents.py +++ b/lib/common/agents.py @@ -863,11 +863,13 @@ class Agents: self.lock.release() - def update_agent_lastseen_db(self, sessionID, current_time=helpers.get_datetime()): + def update_agent_lastseen_db(self, sessionID, current_time=None): """ Update the agent's last seen timestamp in the database. """ + if not current_time: + current_time = helpers.get_datetime() conn = self.get_db_connection() try: self.lock.acquire()