Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
8ac4a207
Commit
8ac4a207
authored
Mar 17, 2024
by
AUTOMATIC1111
Committed by
GitHub
Mar 17, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15299 from AUTOMATIC1111/diskcache-bett
Tweak diskcache limits
parents
f1b090e9
df4da02a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
modules/cache.py
modules/cache.py
+10
-2
No files found.
modules/cache.py
View file @
8ac4a207
...
...
@@ -20,6 +20,14 @@ def dump_cache():
pass
def
make_cache
(
subsection
:
str
)
->
diskcache
.
Cache
:
return
diskcache
.
Cache
(
os
.
path
.
join
(
cache_dir
,
subsection
),
size_limit
=
2
**
32
,
# 4 GB, culling oldest first
disk_min_file_size
=
2
**
18
,
# keep up to 256KB in Sqlite
)
def
convert_old_cached_data
():
try
:
with
open
(
cache_filename
,
"r"
,
encoding
=
"utf8"
)
as
file
:
...
...
@@ -37,7 +45,7 @@ def convert_old_cached_data():
for
subsection
,
keyvalues
in
data
.
items
():
cache_obj
=
caches
.
get
(
subsection
)
if
cache_obj
is
None
:
cache_obj
=
diskcache
.
Cache
(
os
.
path
.
join
(
cache_dir
,
subsection
)
)
cache_obj
=
make_cache
(
subsection
)
caches
[
subsection
]
=
cache_obj
for
key
,
value
in
keyvalues
.
items
():
...
...
@@ -64,7 +72,7 @@ def cache(subsection):
cache_obj
=
caches
.
get
(
subsection
)
if
not
cache_obj
:
cache_obj
=
diskcache
.
Cache
(
os
.
path
.
join
(
cache_dir
,
subsection
)
)
cache_obj
=
make_cache
(
subsection
)
caches
[
subsection
]
=
cache_obj
return
cache_obj
...
...
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