-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
If you wait for a few minutes you can see the memory bloat.
pybar3 version: 0.9.7
from pybars import Compiler, strlist
import json
import time
compiler = Compiler()
from memory_profiler import profile
@profile
def replace_vars(mystr, variables):
def _json(this, item):
return strlist(json.dumps(item))
if isinstance(mystr, str):
try:
template = compiler.compile(mystr)
finally:
pass
return template(variables, helpers={"json": _json})
return mystr
while True:
replace_vars("{{json event}}",
{'event': {'event': 'connectivity.state.changed', 'timestamp': 1640217025.7437212, 'connectStatusOk': False}, 'request': {'httpParams': {'body': '{{json event}}', 'headers': ['User-Agent: Engine', 'Content-Type: application/json'], 'method': 'post' }}})
time.sleep(.1)
Any thoughts for a fix to a way to get around it?
Metadata
Metadata
Assignees
Labels
No labels