diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2022-03-27 23:35:37 +0200 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2022-03-27 23:35:37 +0200 |
| commit | 1d56c732965cad4c8eb06ed5638f7ecdea88f290 (patch) | |
| tree | a3713e8701e344a6a1ae881e44a7616941ddc108 /src_py/hatter/server.py | |
| parent | 1d06423081b04a54d69376f4ac0cea0b40dc5b2d (diff) | |
major rewrite
Diffstat (limited to 'src_py/hatter/server.py')
| -rw-r--r-- | src_py/hatter/server.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src_py/hatter/server.py b/src_py/hatter/server.py index bce5880..5f00707 100644 --- a/src_py/hatter/server.py +++ b/src_py/hatter/server.py @@ -3,6 +3,7 @@ import collections import contextlib import itertools import multiprocessing +import os import subprocess import sys import time @@ -101,7 +102,7 @@ class Server(aio.Resource): try: url = repo_conf['url'] refs = repo_conf.get('refs', ['refs/heads/*']) - min_sync_delay = repo_conf.get('min_sync_delay') or 0 + min_sync_delay = repo_conf.get('min_sync_delay', 60) or 0 max_sync_delay = repo_conf.get('max_sync_delay') last_sync = time.monotonic() - min_sync_delay @@ -173,11 +174,11 @@ async def _execute(action, env, url, ref): *itertools.chain.from_iterable(('--env', i) for i in env), url, ref] - p = await asyncio.create_subprocess_exec(cmd, + p = await asyncio.create_subprocess_exec(*cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, - env=env) + env={**os.environ, **env}) try: output, _ = await p.communicate() @@ -196,7 +197,7 @@ async def _execute(action, env, url, ref): async def _git_ls_remote(url, refs): cmd = ['git', 'ls-remote', url, *refs] - p = await asyncio.create_subprocess_exec(cmd, + p = await asyncio.create_subprocess_exec(*cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
