mirror of
https://github.com/rommapp/romm.git
synced 2026-12-03 10:33:22 +01:00
Changes from self review
This commit is contained in:
@@ -51,6 +51,14 @@ cd backend
|
||||
python main.py
|
||||
```
|
||||
|
||||
|
||||
### - Start a worker
|
||||
|
||||
```sh
|
||||
cd backend
|
||||
python worker.py
|
||||
```
|
||||
|
||||
## Setting up the frontend
|
||||
|
||||
### - Install node.js dependencies
|
||||
|
||||
@@ -6,7 +6,6 @@ from logger.logger import log
|
||||
from utils import fs, fastapi
|
||||
from utils.exceptions import PlatformsNotFoundException, RomsNotFoundException
|
||||
from handler import dbh
|
||||
from models.rom import Rom
|
||||
from handler.socket_manager import socket_server
|
||||
from worker import redis_conn, redis_url
|
||||
|
||||
@@ -33,7 +32,7 @@ async def scan_platforms(paltforms: str, complete_rescan: bool):
|
||||
scanned_platform = fastapi.scan_platform(p_slug)
|
||||
except RomsNotFoundException as e:
|
||||
log.error(e)
|
||||
return
|
||||
continue
|
||||
|
||||
await sm.emit(
|
||||
"scan:scanning_platform",
|
||||
@@ -49,7 +48,7 @@ async def scan_platforms(paltforms: str, complete_rescan: bool):
|
||||
if rom_id and not complete_rescan:
|
||||
continue
|
||||
|
||||
scanned_rom: Rom = fastapi.scan_rom(scanned_platform, rom)
|
||||
scanned_rom = fastapi.scan_rom(scanned_platform, rom)
|
||||
await sm.emit(
|
||||
"scan:scanning_rom",
|
||||
{
|
||||
|
||||
@@ -235,12 +235,13 @@ class TwitchAuth:
|
||||
sys.exit(2)
|
||||
|
||||
# Set token in redis to expire in <expires_in> seconds
|
||||
redis_client.set("twitch_token", token, ex=expires_in)
|
||||
redis_client.set("twitch_token", token, ex=expires_in - 10)
|
||||
log.info("Twitch token fetched!")
|
||||
|
||||
return token
|
||||
|
||||
def get_oauth_token(self) -> str:
|
||||
# Use a fake token when running tests
|
||||
if "pytest" in sys.modules:
|
||||
return "test_token"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user