fix: restore smoke-init CI pipeline using mock Forgejo (#124)
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/smoke-init Pipeline failed

This commit is contained in:
Agent 2026-04-02 09:04:47 +00:00
parent 105070e379
commit 7190abb4e1
3 changed files with 4 additions and 6 deletions

View file

@ -695,6 +695,7 @@ class ForgejoHandler(BaseHTTPRequestHandler):
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
"""Threaded HTTP server for handling concurrent requests."""
daemon_threads = True
allow_reuse_address = True
def main():
@ -702,10 +703,7 @@ def main():
global SHUTDOWN_REQUESTED
port = int(os.environ.get("MOCK_FORGE_PORT", 3000))
# Set SO_REUSEADDR before creating the server to allow port reuse
class ReusableHTTPServer(ThreadingHTTPServer):
allow_reuse_address = True
server = ReusableHTTPServer(("0.0.0.0", port), ForgejoHandler)
server = ThreadingHTTPServer(("0.0.0.0", port), ForgejoHandler)
print(f"Mock Forgejo server starting on port {port}", file=sys.stderr)