Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
math_tutor_dev
public_math_tutor
Commits
05a1d5b1
Commit
05a1d5b1
authored
Apr 28, 2026
by
Kantz
Browse files
zeitzohne nochmal angepasst
parent
0ae33edc
Changes
2
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/deterministic_services/context_stores/context_store_base.py
View file @
05a1d5b1
...
...
@@ -4,7 +4,8 @@ import hashlib
import
json
import
os
from
glob
import
glob
from
datetime
import
datetime
,
timezone
from
datetime
import
datetime
from
zoneinfo
import
ZoneInfo
from
threading
import
Lock
from
typing
import
Any
...
...
@@ -30,12 +31,12 @@ def _resolve_latest_path(chat_id: str) -> str | None:
return
None
def
_
utc
_now
()
->
str
:
return
datetime
.
now
(
timezone
.
mez
).
strftime
(
"%Y-%m-%dT%H:%M:%SZ"
)
def
_
mez
_now
()
->
str
:
return
datetime
.
now
(
ZoneInfo
(
"Europe/Berlin"
)
).
strftime
(
"%Y-%m-%dT%H:%M:%SZ"
)
def
_touch
(
sheet
:
dict
[
str
,
Any
])
->
None
:
sheet
[
"updated_at"
]
=
_
utc
_now
()
sheet
[
"updated_at"
]
=
_
mez
_now
()
def
touch_sheet
(
sheet
:
dict
[
str
,
Any
])
->
None
:
...
...
@@ -56,7 +57,7 @@ def get_chat_id(messages: list[dict], draft: str | None = None) -> str:
def
init_sheet_base
(
chat_id
:
str
,
messages
:
list
[
dict
])
->
dict
[
str
,
Any
]:
timestamp
=
_
utc
_now
()
timestamp
=
_
mez
_now
()
return
{
"chat_id"
:
chat_id
,
"created_at"
:
timestamp
,
...
...
@@ -190,7 +191,7 @@ def get_decisions(sheet: dict[str, Any]) -> list[dict[str, Any]]:
def
add_decision
(
sheet
:
dict
[
str
,
Any
],
decision
:
dict
[
str
,
Any
])
->
None
:
entry
=
{
"timestamp"
:
_
utc
_now
(),
**
decision
}
entry
=
{
"timestamp"
:
_
mez
_now
(),
**
decision
}
sheet
.
setdefault
(
"decisions"
,
[]).
append
(
entry
)
_touch
(
sheet
)
...
...
math-tutor/backend/app/deterministic_services/tool_logging.py
View file @
05a1d5b1
import
json
import
os
from
datetime
import
datetime
,
timezone
from
datetime
import
datetime
from
zoneinfo
import
ZoneInfo
def
format_log_timestamp
(
created_at
:
str
|
None
)
->
str
:
if
not
created_at
:
return
datetime
.
now
(
timezone
.
mez
).
strftime
(
"%Y-%m-%dT%H:%M:%SZ"
)
return
datetime
.
now
(
ZoneInfo
(
"Europe/Berlin"
)
).
strftime
(
"%Y-%m-%dT%H:%M:%SZ"
)
try
:
parsed
=
datetime
.
strptime
(
created_at
,
"%Y-%m-%dT%H:%M:%SZ"
)
return
parsed
.
strftime
(
"%Y-%m-%dT%H:%M:%SZ"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment