Skip to content

Commit

Permalink
fix migration file_path field
Browse files Browse the repository at this point in the history
  • Loading branch information
gantoine committed Dec 22, 2024
1 parent b398e70 commit bb7913e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion backend/alembic/versions/0029_rom_file_and_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def upgrade() -> None:
SELECT
r.id AS rom_id,
JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.filename')) AS file_name,
r.file_path AS file_path,
CASE WHEN r.multi = 0 THEN r.file_path ELSE CONCAT(r.file_path, r.file_name) END AS file_path,
JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.size')) AS file_size_bytes,
JSON_UNQUOTE(JSON_EXTRACT(file_data, '$.last_modified')) AS last_modified,
CASE WHEN r.multi = 0 THEN r.crc_hash ELSE NULL END AS crc_hash,
Expand Down
39 changes: 19 additions & 20 deletions backend/endpoints/sockets/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,11 @@ async def _identify_rom(
if not rom or scan_type == ScanType.COMPLETE or scan_type == ScanType.HASHES:
# Skip hashing games for platforms that don't have a hash database
if platform.slug not in NON_HASHABLE_PLATFORMS:
_set_rom_hashes(_added_rom.id)
# low_prio_queue.enqueue(
# _set_rom_hashes,
# _added_rom.id,
# job_timeout=60 * 15, # Timeout (15 minutes)
# )
low_prio_queue.enqueue(
_set_rom_hashes,
_added_rom.id,
job_timeout=60 * 15, # Timeout (15 minutes)
)

# Return early if we're only scanning for hashes
if scan_type == ScanType.HASHES:
Expand Down Expand Up @@ -504,22 +503,22 @@ async def scan_handler(_sid: str, options: dict):
metadata_sources = options.get("apis", [])

# Uncomment this to run scan in the current process
await scan_platforms(
platform_ids=platform_ids,
scan_type=scan_type,
roms_ids=roms_ids,
metadata_sources=metadata_sources,
)

# return high_prio_queue.enqueue(
# scan_platforms,
# platform_ids,
# scan_type,
# roms_ids,
# metadata_sources,
# job_timeout=SCAN_TIMEOUT, # Timeout (default of 4 hours)
# await scan_platforms(
# platform_ids=platform_ids,
# scan_type=scan_type,
# roms_ids=roms_ids,
# metadata_sources=metadata_sources,
# )

return high_prio_queue.enqueue(
scan_platforms,
platform_ids,
scan_type,
roms_ids,
metadata_sources,
job_timeout=SCAN_TIMEOUT, # Timeout (default of 4 hours)
)


@socket_handler.socket_server.on("scan:stop")
async def stop_scan_handler(_sid: str):
Expand Down

0 comments on commit bb7913e

Please sign in to comment.