From 29a86c22124a9cc03bd9bea2b06fde972c1df0a9 Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Mon, 20 Oct 2025 12:29:17 +0200 Subject: [PATCH] cleaned referencing to services --- .../services/serviceGeneration/renderers/rendererDocx.py | 5 ----- modules/services/serviceWorkflow/mainServiceWorkflow.py | 6 +----- modules/workflows/workflowManager.py | 9 ++++----- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/modules/services/serviceGeneration/renderers/rendererDocx.py b/modules/services/serviceGeneration/renderers/rendererDocx.py index d744b7e5..90e09599 100644 --- a/modules/services/serviceGeneration/renderers/rendererDocx.py +++ b/modules/services/serviceGeneration/renderers/rendererDocx.py @@ -7,17 +7,12 @@ from typing import Dict, Any, Tuple, List import io import base64 import re -import os -from datetime import datetime, UTC try: from docx import Document from docx.shared import Inches, Pt, RGBColor from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.enum.table import WD_TABLE_ALIGNMENT - from docx.oxml.shared import OxmlElement, qn - from docx.oxml.ns import nsdecls - from docx.oxml import parse_xml DOCX_AVAILABLE = True except ImportError: DOCX_AVAILABLE = False diff --git a/modules/services/serviceWorkflow/mainServiceWorkflow.py b/modules/services/serviceWorkflow/mainServiceWorkflow.py index d9aaaa9f..54ddc48f 100644 --- a/modules/services/serviceWorkflow/mainServiceWorkflow.py +++ b/modules/services/serviceWorkflow/mainServiceWorkflow.py @@ -3,10 +3,6 @@ import uuid from typing import Dict, Any, List, Optional from modules.datamodels.datamodelUam import User, UserConnection from modules.datamodels.datamodelChat import ChatDocument, ChatMessage, ChatStat, ChatLog -from modules.datamodels.datamodelChat import ChatContentExtracted -from modules.services.serviceExtraction.mainServiceExtraction import ExtractionService -from modules.services.serviceGeneration.subDocumentUtility import getFileExtension, getMimeTypeFromExtension, detectContentTypeFromData -from modules.shared.timezoneUtils import get_utc_timestamp from modules.security.tokenManager import TokenManager from modules.shared.progressLogger import ProgressLogger @@ -225,7 +221,7 @@ Please provide a comprehensive summary of this conversation.""" token = TokenManager().getFreshToken(connection.id) if token: if hasattr(token, 'expiresAt') and token.expiresAt: - current_time = get_utc_timestamp() + current_time = self.services.utils.timestampGetUtc() if current_time > token.expiresAt: token_status = "expired" else: diff --git a/modules/workflows/workflowManager.py b/modules/workflows/workflowManager.py index 743f840e..e220fe69 100644 --- a/modules/workflows/workflowManager.py +++ b/modules/workflows/workflowManager.py @@ -13,7 +13,6 @@ from modules.datamodels.datamodelChat import ( ) from modules.datamodels.datamodelChat import TaskItem, TaskStatus, TaskContext from modules.workflows.processing.workflowProcessor import WorkflowProcessor, WorkflowStoppedException -from modules.shared.timezoneUtils import get_utc_timestamp logger = logging.getLogger(__name__) @@ -611,7 +610,7 @@ class WorkflowManager: # Update workflow status to stopped workflow.status = "stopped" - workflow.lastActivity = get_utc_timestamp() + workflow.lastActivity = self.services.utils.timestampGetUtc() self.services.workflow.updateWorkflow(workflow.id, { "status": "stopped", "lastActivity": workflow.lastActivity, @@ -626,7 +625,7 @@ class WorkflowManager: "message": "🛑 Workflow stopped by user", "status": "last", "sequenceNr": len(workflow.messages) + 1, - "publishedAt": get_utc_timestamp(), + "publishedAt": self.services.utils.timestampGetUtc(), "documentsLabel": "workflow_stopped", "documents": [], # Add workflow context fields @@ -653,7 +652,7 @@ class WorkflowManager: # Update workflow status to failed workflow.status = "failed" - workflow.lastActivity = get_utc_timestamp() + workflow.lastActivity = self.services.utils.timestampGetUtc() self.services.workflow.updateWorkflow(workflow.id, { "status": "failed", "lastActivity": workflow.lastActivity, @@ -668,7 +667,7 @@ class WorkflowManager: "message": f"Workflow processing failed: {str(error)}", "status": "last", "sequenceNr": len(workflow.messages) + 1, - "publishedAt": get_utc_timestamp(), + "publishedAt": self.services.utils.timestampGetUtc(), "documentsLabel": "workflow_error", "documents": [], # Add workflow context fields