Skip to content

Bug/issue-138/correct-bad-loglevels #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions resolve_proxy_encoder/app/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ def check_worker_presence():
"""Warn user if no celery workers are available"""

online_workers = celery_app.control.inspect().active_queues()

if not online_workers:

logger.warning(
"[yellow]There are no workers currently online to process jobs!\n"
"Make sure you start at least one."
)

logger.debug(f"[magenta]Online workers:[/]\n{online_workers}")
return online_workers

Expand Down Expand Up @@ -105,7 +97,7 @@ def check_for_updates(github_url: str, package_name: str) -> Union[dict, None]:
}


def check_worker_compatability(online_workers):
def check_worker_compatibility(online_workers):

if settings["app"]["disable_version_constrain"]:
logger.warning(
Expand All @@ -115,7 +107,7 @@ def check_worker_compatability(online_workers):
return

spinner = yaspin(
text="Checking worker compatability...",
text="Checking worker compatibility...",
color="cyan",
)

Expand All @@ -124,12 +116,14 @@ def check_worker_compatability(online_workers):

spinner.fail("❌ ")
logger.warning(
"[yellow]No workers found. Can't check compatability.\n"
"[yellow]No workers found. Can't check compatibility.\n"
+ "Jobs may not be received if no compatible workers are available!\n[/]"
+ "[red]CONTINUE AT OWN RISK![/]\n"
)

if not Confirm.ask("[cyan]Do you wish to continue?[/]"):
if not Confirm.ask(
"[yellow]No workers found.[/] [cyan]Do you wish to continue?[/]"
):
core.app_exit(1, -1)

return
Expand Down
2 changes: 1 addition & 1 deletion resolve_proxy_encoder/app/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def queue():
DaVinci Resolve timeline
"""

checks.check_worker_compatability(settings["online_workers"])
checks.check_worker_compatibility(settings["online_workers"])

print("\n")
console.rule(
Expand Down
2 changes: 1 addition & 1 deletion resolve_proxy_encoder/app/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def install_rich_tracebacks(show_locals=False):
install(show_locals=show_locals)


def app_exit(level: int = 0, timeout: int = -1, cleanup_funcs: list = []):
def app_exit(level: int = 0, timeout: int = 0, cleanup_funcs: list = []):

"""
Exit function to allow time to
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion resolve_proxy_encoder/queuer/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_proxy_path():
f = Prompt.ask("Enter path to search for proxies")
if f is None:
print("User cancelled. Exiting.")
exit(0)
core.app_exit(0, 0)
return f


Expand Down
3 changes: 1 addition & 2 deletions resolve_proxy_encoder/queuer/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ def main():

except Exception as e:

print("[red]Couldn't link jobs. Link manually:[/]")
print(e)
logger.error(f"[red]Couldn't link jobs. Link manually.[/]\nError: {e}")
core.app_exit(1, -1)


Expand Down
8 changes: 4 additions & 4 deletions resolve_proxy_encoder/queuer/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _populate_variables(self):

except:

logger.warning(
logger.critical(
"[red] :warning: Couldn't access the Resolve Python API. Is DaVinci Resolve running?[/]"
)
core.app_exit(1, -1)
Expand All @@ -69,7 +69,7 @@ def _populate_variables(self):

except:

logger.warning(
logger.critical(
"[red] :warning: Couldn't get current project. Is a project open in Resolve?[/]"
)
core.app_exit(1, -1)
Expand All @@ -81,7 +81,7 @@ def _populate_variables(self):
raise TypeError
except:

logger.warning(
logger.critical(
"[red] :warning: Couldn't get current timeline. Is a timeline open in Resolve?[/]"
)
core.app_exit(1, -1)
Expand All @@ -94,7 +94,7 @@ def _populate_variables(self):

except:

logger.warning("[red] :warning: Couldn't get Resolve's media pool.[/]")
logger.critical("[red] :warning: Couldn't get Resolve's media pool.[/]")
core.app_exit(1, -1)


Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions resolve_proxy_encoder/settings/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _ensure_user_file(self):
except OSError:

self.spinner.fail("❌ ")
logger.error("[red]Error creating directory![/]")
logger.critical("[red]Error creating directory![/]")
core.app_exit(1, -1)

try:
Expand All @@ -187,7 +187,7 @@ def _ensure_user_file(self):
except:

self.spinner.fail("❌ ")
print(
logger.error(
f"[red]Couldn't copy default settings to {self.user_file}![/]"
)
core.app_exit(1, -1)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 1 addition & 3 deletions resolve_proxy_encoder/worker/ffmpeg/ffmpeg_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ def run(self, logfile):
except KeyboardInterrupt:
progress_bar.stop()
process.kill()
logger.warning(
"[yellow][KeyboardInterrupt] FFmpeg process killed. Exiting...[/]"
)
print("[yellow][KeyboardInterrupt] FFmpeg process killed. Exiting...[/]")
core.app_exit(0)

except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion resolve_proxy_encoder/worker/launch_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_celery_binary_path():
if celery_bin:
return celery_bin
logger.warning(
"[yellow]Using Celery on path." + "Please ensure version compatability![/]"
"[yellow]Using Celery on path." + "Please ensure version compatibility![/]"
)

logger.error("[red]Couldn't find celery binary! Is it installed?[/]")
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion resolve_proxy_encoder/worker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_queue():

logger.warning(
"[yellow]Version constrain is disabled!\n"
"You [bold]must[/] ensure routing and version compatability yourself!"
"You [bold]must[/] ensure routing and version compatibility yourself!"
)

return "celery"
Expand Down