Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MBetterc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mbetter
MBetterc
Commits
adf01f7a
Commit
adf01f7a
authored
Dec 17, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better zip validation
parent
1f2b9534
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
games_thread.py
mbetterclient/core/games_thread.py
+36
-0
No files found.
mbetterclient/core/games_thread.py
View file @
adf01f7a
...
...
@@ -112,6 +112,9 @@ class GamesThread(ThreadedComponent):
# Clean up any stale 'ingame' matches from previous crashed sessions
self
.
_cleanup_stale_ingame_matches
()
# Validate all unvalidated ZIP files at launch
self
.
_validate_all_pending_zips_at_launch
()
# Register with message bus first
self
.
message_queue
=
self
.
message_bus
.
register_component
(
self
.
name
)
...
...
@@ -970,6 +973,39 @@ class GamesThread(ThreadedComponent):
except
Exception
as
e
:
logger
.
error
(
f
"Failed to start async ZIP validation for fixture {fixture_id}: {e}"
)
def
_validate_all_pending_zips_at_launch
(
self
):
"""Validate all ZIP files that are not yet validated at application launch"""
try
:
logger
.
info
(
"Starting validation of all unvalidated ZIP files at launch"
)
session
=
self
.
db_manager
.
get_session
()
try
:
# Get all active matches with ZIP files that are not validated
pending_matches
=
session
.
query
(
MatchModel
)
.
filter
(
MatchModel
.
active_status
==
True
,
MatchModel
.
zip_filename
.
isnot
(
None
),
MatchModel
.
zip_validation_status
.
in_
([
'pending'
,
None
])
)
.
all
()
if
not
pending_matches
:
logger
.
info
(
"No unvalidated ZIP files found at launch"
)
return
logger
.
info
(
f
"Found {len(pending_matches)} unvalidated ZIP files to validate at launch"
)
# Validate each pending ZIP file
for
match
in
pending_matches
:
# Start validation for this match
self
.
_validate_single_zip_async
(
match
.
id
,
session
)
finally
:
session
.
close
()
logger
.
info
(
"Launch-time ZIP validation initiated for all pending files"
)
except
Exception
as
e
:
logger
.
error
(
f
"Failed to start launch-time ZIP validation: {e}"
)
def
_validate_fixture_zips_async
(
self
,
fixture_id
:
str
):
"""Validate ZIP files for a fixture asynchronously"""
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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