Skip to content

Commit

Permalink
Do not compute checksums on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Nov 7, 2023
1 parent aa133c3 commit b81cc14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions gns3server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,11 @@ def main():
Entry point for GNS3 server
"""

if hasattr(sys, "frozen"):
multiprocessing.freeze_support()
multiprocessing.set_start_method("spawn")

if not sys.platform.startswith("win"):
if "--daemon" in sys.argv:
daemonize()
else:
multiprocessing.freeze_support()

from gns3server.run import run
run()
Expand Down
5 changes: 4 additions & 1 deletion gns3server/web/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import time
import atexit
import weakref
import concurrent.futures

# Import encoding now, to avoid implicit import later.
# Implicit import within threads may cause LookupError when standard library is in a ZIP
Expand Down Expand Up @@ -238,7 +237,11 @@ async def _compute_image_checksums(self):
Compute image checksums.
"""

if sys.platform.startswith("darwin") and hasattr(sys, "frozen"):
# do not compute on macOS because errors
return
loop = asyncio.get_event_loop()
import concurrent.futures
with concurrent.futures.ProcessPoolExecutor(max_workers=1) as pool:
try:
log.info("Computing image checksums...")
Expand Down

0 comments on commit b81cc14

Please sign in to comment.