fix: improve error handling in rq-docker script

- Use python3 in shebang for explicit Python 3
- Add exception handling in main() to log errors properly

Co-authored-by: abhi1693 <5083532+abhi1693@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-02 14:57:41 +00:00
parent 35b3829da0
commit 15cfcbf336

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
"""RQ worker entrypoint for Docker containers.""" """RQ worker entrypoint for Docker containers."""
from __future__ import annotations from __future__ import annotations
@@ -39,7 +39,13 @@ def build_parser() -> argparse.ArgumentParser:
def main() -> None: def main() -> None:
parser = build_parser() parser = build_parser()
args = parser.parse_args() args = parser.parse_args()
sys.exit(args.func(args)) try:
sys.exit(args.func(args))
except Exception:
# Log unexpected errors before exiting
import traceback
traceback.print_exc()
sys.exit(1)
if __name__ == "__main__": if __name__ == "__main__":