refactor(services): remove too many imports and cleanup

pull/98/head
Houkime 2024-03-01 14:30:54 +00:00 committed by Inex Code
parent 305e5cc2c3
commit 3f9d2b2481
3 changed files with 6 additions and 8 deletions

View File

@ -30,7 +30,5 @@ def move_service(service_id: str, volume_name: str) -> Job:
description=f"Moving {service.get_display_name()} data to {volume.name}",
)
handle = move_service_task(service, volume, job)
# Nonblocking
handle()
move_service_task(service, volume, job)
return job

View File

@ -5,7 +5,6 @@ import strawberry
from selfprivacy_api.graphql import IsAuthenticated
from selfprivacy_api.graphql.common_types.jobs import job_to_api_job
from selfprivacy_api.jobs import JobStatus
from selfprivacy_api.utils.block_devices import BlockDevices
from traceback import format_tb as format_traceback
@ -23,7 +22,6 @@ from selfprivacy_api.actions.services import (
ServiceNotFoundError,
VolumeNotFoundError,
)
from selfprivacy_api.services.moving import MoveError
from selfprivacy_api.services import get_service_by_id

View File

@ -268,10 +268,12 @@ class Jobs:
return False
# A terse way to call a common operation, for readability
# job.report_progress() would be even better
# but it would go against how this file is written
def report_progress(progress: int, job: Job, status_text: str) -> None:
"""
A terse way to call a common operation, for readability
job.report_progress() would be even better
but it would go against how this file is written
"""
Jobs.update(
job=job,
status=JobStatus.RUNNING,