File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,7 +182,9 @@ def datetime_replacer(match):
182182 else :
183183 now = datetime .datetime .now ()
184184 return now .strftime (fmt )
185- line ['text' ] = re .sub (r"\{\{datetime:([^}]+)\}\}" , datetime_replacer , line ['text' ])
185+ # Performance issue mitigation
186+ if len (line ['text' ]) < 100 :
187+ line ['text' ] = re .sub (r"\{\{datetime:([^}]+)\}\}" , datetime_replacer , line ['text' ])
186188
187189 # Replace {{uuid}} with a new UUID
188190 if "{{uuid}}" in line ['text' ]:
@@ -196,7 +198,9 @@ def datetime_replacer(match):
196198 def env_replacer (match ):
197199 var_name = match .group (1 )
198200 return os .getenv (var_name , "" )
199- line ['text' ] = re .sub (r"\{\{env:([^}]+)\}\}" , env_replacer , line ['text' ])
201+ # Performance issue mitigation
202+ if len (line ['text' ]) < 100 :
203+ line ['text' ] = re .sub (r"\{\{env:([^}]+)\}\}" , env_replacer , line ['text' ])
200204
201205 # Increment counter
202206 self ._counter += 1
You can’t perform that action at this time.
0 commit comments