Skip to content

Commit

Permalink
fix datetime string in workflow model
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Jan 28, 2024
1 parent 0f10475 commit c552b64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Settings(BaseSettings):
pflink_mongodb: MongoDsn = 'mongodb://localhost:27017'
version: str = "3.8.2"
version: str = "3.8.4"
mongo_username: str = "admin"
mongo_password: str = "admin"
log_level: str = "DEBUG"
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/subprocesses/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import datetime
from datetime import datetime
import hashlib
import json
import requests
Expand Down Expand Up @@ -42,7 +42,7 @@ def workflow_retrieve_helper(workflow: dict) -> WorkflowDBSchema:
return WorkflowDBSchema(
key=workflow["_id"],
fingerprint=workflow["fingerprint"],
creation_time=datetime.datetime.min if not workflow.get("creation_time") else workflow["creation_time"],
creation_time=datetime.min.strftime("%Y-%m-%d %H:%M:%S") if not workflow.get("creation_time") else workflow["creation_time"],
request=request,
response=workflow["response"],
service_retry=workflow["service_retry"],
Expand Down
4 changes: 2 additions & 2 deletions app/models/workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import datetime
from datetime import datetime
import pytz
from pydantic import BaseModel, Field, ValidationError, validator
from enum import Enum
Expand Down Expand Up @@ -158,7 +158,7 @@ class WorkflowDBSchema(BaseModel):
"""The DB model of a workflow object"""
key: str = ""
fingerprint: str = ""
creation_time: datetime.datetime = datetime.datetime.now(datetime.timezone.utc)
creation_time: str = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
request: WorkflowRequestSchema
response: WorkflowStatusResponseSchema
service_retry: int = 5
Expand Down

0 comments on commit c552b64

Please sign in to comment.