|
@@ -162,8 +162,8 @@ class DialogueManager:
|
|
self.unprocessed_messages.append(entry['content'])
|
|
self.unprocessed_messages.append(entry['content'])
|
|
break
|
|
break
|
|
else:
|
|
else:
|
|
- # 默认设置为24小时前
|
|
|
|
- self.last_interaction_time = int(time.time() * 1000) - 24 * 3600 * 1000
|
|
|
|
|
|
+ # 默认设置
|
|
|
|
+ self.last_interaction_time = int(time.time() * 1000) - minutes_to_get * 60 * 1000
|
|
time_for_read = datetime.fromtimestamp(self.last_interaction_time / 1000).strftime("%Y-%m-%d %H:%M:%S")
|
|
time_for_read = datetime.fromtimestamp(self.last_interaction_time / 1000).strftime("%Y-%m-%d %H:%M:%S")
|
|
logger.debug(f"staff[{self.staff_id}], user[{self.user_id}]: state: {self.current_state.name}, last_interaction: {time_for_read}")
|
|
logger.debug(f"staff[{self.staff_id}], user[{self.user_id}]: state: {self.current_state.name}, last_interaction: {time_for_read}")
|
|
|
|
|
|
@@ -456,6 +456,8 @@ class DialogueManager:
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def is_time_suitable_for_active_conversation(time_context=None) -> bool:
|
|
def is_time_suitable_for_active_conversation(time_context=None) -> bool:
|
|
|
|
+ if configs.get_env() == 'dev':
|
|
|
|
+ return True
|
|
if not time_context:
|
|
if not time_context:
|
|
time_context = DialogueManager.get_time_context()
|
|
time_context = DialogueManager.get_time_context()
|
|
if time_context in [TimeContext.MORNING,
|
|
if time_context in [TimeContext.MORNING,
|