Skip to content

Commit

Permalink
try to fix ci...
Browse files Browse the repository at this point in the history
  • Loading branch information
joshday committed Jul 12, 2023
1 parent 6d93e5d commit 9ddaccc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/julia-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Julia Tests

name: Correctness - Julia
env:
JULIA_NUM_THREADS: 2
on:
push:
branches: ['main']
Expand All @@ -12,6 +10,8 @@ on:

jobs:
test:
env:
JULIA_NUM_THREADS: 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 6 additions & 2 deletions src/SimulationService.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ end

#-----------------------------------------------------------------------------# start!
function start!(; host=SIMSERVICE_HOST, port=SIMSERVICE_PORT, kw...)
Threads.nthreads() > 1 || error("Server require `Thread.nthreads() > 1`. Start Julia via `julia --threads=auto`.")
SIMSERVICE_ENABLE_TDS || @warn "TDS is disabled. Some features will not work."
stop!() # Stop server if it's already running
server_url[] = "http://$host:$port"
Expand All @@ -91,7 +90,12 @@ function start!(; host=SIMSERVICE_HOST, port=SIMSERVICE_PORT, kw...)
# Oxygen.mergeschema(swagger)

# server:
Oxygen.serveparallel(; host, port, async=true, kw...)
if Threads.nthreads() > 1 # true in production
Oxygen.serveparallel(; host, port, async=true, kw...)
else
@warn "Server starting single-threaded. This should only be used for testing. Try starting Julia via `julia --threads=auto`."
Oxygen.serve(; host, port, async=true, kw...)
end
end

#-----------------------------------------------------------------------------# stop!
Expand Down

0 comments on commit 9ddaccc

Please sign in to comment.