Skip to content

Commit 31f12be

Browse files
authored
rollback
1 parent 42ebf90 commit 31f12be

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

frameworks/Python/blacksheep/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
READ_ROW_SQL = 'SELECT "id", "randomnumber" FROM "world" WHERE id = $1'
1717
WRITE_ROW_SQL = 'UPDATE "world" SET "randomnumber"=$1 WHERE id=$2'
1818
ADDITIONAL_ROW = [0, "Additional fortune added at request time."]
19-
MAX_CONNECTIONS = 1000
19+
MAX_CONNECTIONS = 1800
2020
CORE_COUNT = multiprocessing.cpu_count()
2121
WORKER_PROCESSES = CORE_COUNT
2222
MAX_POOL_SIZE = max(1, MAX_CONNECTIONS // WORKER_PROCESSES)

frameworks/Python/blacksheep/blacksheep-nginx-unit.dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ RUN CORE_COUNT=$(nproc) && \
1414
MAX_PROCESSES=$((CORE_COUNT)) && \
1515
sed -i "s|\"processes\": [0-9]*|\"processes\": $MAX_PROCESSES|g" /blacksheep/unit-config.json
1616

17-
RUN unitd && \
18-
curl -X PUT --data-binary @/blacksheep/unit-config.json --unix-socket \
19-
/var/run/control.unit.sock http://localhost/config
17+
RUN chmod +x start-unit.sh
2018

2119
ENTRYPOINT []
2220
EXPOSE 8080
23-
CMD ["unitd", "--no-daemon", "--control", "unix:/var/run/control.unit.sock"]
21+
CMD ["./start-unit.sh"]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
unitd --no-daemon --control unix:/var/run/control.unit.sock &
4+
5+
# wait UNIT started
6+
sleep 1
7+
8+
# PUT configure
9+
curl -X PUT \
10+
--data-binary @unit-config.json \
11+
--unix-socket /var/run/control.unit.sock \
12+
http://localhost/config
13+
14+
# Then keep the container alive
15+
wait

0 commit comments

Comments
 (0)