Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
a03dde19
Commit
a03dde19
authored
Nov 20, 2023
by
comfyanonymous
Browse files
Cap maximum history size at 10000. Delete oldest entry when reached.
parent
31c5ea7b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
execution.py
execution.py
+3
-0
No files found.
execution.py
View file @
a03dde19
...
...
@@ -681,6 +681,7 @@ def validate_prompt(prompt):
return
(
True
,
None
,
list
(
good_outputs
),
node_errors
)
MAXIMUM_HISTORY_SIZE
=
10000
class
PromptQueue
:
def
__init__
(
self
,
server
):
...
...
@@ -713,6 +714,8 @@ class PromptQueue:
def
task_done
(
self
,
item_id
,
outputs
):
with
self
.
mutex
:
prompt
=
self
.
currently_running
.
pop
(
item_id
)
if
len
(
self
.
history
)
>
MAXIMUM_HISTORY_SIZE
:
self
.
history
.
pop
(
next
(
iter
(
self
.
history
)))
self
.
history
[
prompt
[
1
]]
=
{
"prompt"
:
prompt
,
"outputs"
:
{}
}
for
o
in
outputs
:
self
.
history
[
prompt
[
1
]][
"outputs"
][
o
]
=
outputs
[
o
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment