Skip to content

Commit 6bb0f4d

Browse files
committed
Adjust defaults
1 parent c115260 commit 6bb0f4d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This mod gives SWAG the ability to start containers on-demand when accessed thro
2424
'"$http_referer" "$http_user_agent"';
2525
access_log /config/log/nginx/access.log main;
2626
```
27-
- *Optional* - In SWAG's docker arguments, set an environment variable `SWAG_ONDEMAND_STOP_THRESHOLD` to override the period of inactivity in seconds before stopping the container. Defaults to `1800` which is 30 minutes.
27+
- *Optional* - In SWAG's docker arguments, set an environment variable `SWAG_ONDEMAND_STOP_THRESHOLD` to override the period of inactivity in seconds before stopping the container. Defaults to `600` which is 10 minutes.
2828
```yaml
2929
swag:
3030
container_name: swag

root/app/swag-ondemand.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
ACCESS_LOG_FILE = "/config/log/nginx/access.log"
99
LOG_FILE = "/config/log/ondemand/ondemand.log"
10-
STOP_THRESHOLD = int(os.environ.get("SWAG_ONDEMAND_STOP_THRESHOLD", "1800"))
10+
STOP_THRESHOLD = int(os.environ.get("SWAG_ONDEMAND_STOP_THRESHOLD", "600"))
1111

1212
last_accessed_urls = set()
1313
last_accessed_urls_lock = threading.Lock()
@@ -97,7 +97,7 @@ def tail(self, f):
9797
while True:
9898
line = f.readline()
9999
if not line:
100-
time.sleep(0.1)
100+
time.sleep(1)
101101
if os.stat(ACCESS_LOG_FILE).st_ino != inode:
102102
f.close()
103103
f = open(ACCESS_LOG_FILE, 'r')

0 commit comments

Comments
 (0)