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
c87bb53c
Commit
c87bb53c
authored
Mar 18, 2026
by
Kantz
Browse files
fehler mit fehlendem Context-Sheet gefixed
parent
d1b0dbde
Changes
1
Show whitespace changes
Inline
Side-by-side
math-tutor/backend/app/deterministic_services/context_stores/context_store_base.py
View file @
c87bb53c
...
...
@@ -23,10 +23,11 @@ def _latest_filename_pattern(chat_id: str) -> str:
return
os
.
path
.
join
(
_LOG_DIR
,
f
"*_
{
chat_id
}
_latest.json"
)
def
_resolve_latest_path
(
chat_id
:
str
)
->
str
:
def
_resolve_latest_path
(
chat_id
:
str
)
->
str
|
None
:
matches
=
glob
(
_latest_filename_pattern
(
chat_id
))
if
matches
:
return
max
(
matches
,
key
=
os
.
path
.
getmtime
)
return
None
def
_utc_now
()
->
str
:
...
...
@@ -73,7 +74,7 @@ def load_sheet(chat_id: str) -> dict[str, Any] | None:
return
_CACHE
[
chat_id
]
latest_path
=
_resolve_latest_path
(
chat_id
)
if
os
.
path
.
exists
(
latest_path
):
if
latest_path
and
os
.
path
.
exists
(
latest_path
):
with
open
(
latest_path
,
"r"
,
encoding
=
"utf-8"
)
as
file_handle
:
sheet
=
json
.
load
(
file_handle
)
with
_LOCK
:
...
...
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