Add delay support in the poussetaches client

This commit is contained in:
Thomas Sileo 2019-04-15 22:14:26 +02:00
parent aa9ca2d868
commit 5c7cc491f5

View file

@ -39,7 +39,7 @@ class PousseTaches:
self.base_url = base_url self.base_url = base_url
def push( def push(
self, payload: Any, path: str, expected: int = 200, schedule: str = "" self, payload: Any, path: str, expected: int = 200, schedule: str = "", delay: int = 0,
) -> str: ) -> str:
# Encode our payload # Encode our payload
p = base64.b64encode(json.dumps(payload).encode()).decode() p = base64.b64encode(json.dumps(payload).encode()).decode()
@ -52,6 +52,7 @@ class PousseTaches:
"payload": p, "payload": p,
"expected": expected, "expected": expected,
"schedule": schedule, "schedule": schedule,
"delay": delay,
}, },
) )
resp.raise_for_status() resp.raise_for_status()