mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
add tid to cache name to avoid non-safe uuid4 on windows
This commit is contained in:
parent
a84f3058e2
commit
bd833900a3
@ -1,3 +1,4 @@
|
||||
import threading
|
||||
import tempfile
|
||||
import typing
|
||||
from dataclasses import dataclass
|
||||
@ -70,7 +71,8 @@ class ObjectSerializerDisk(ObjectSerializerBase[T]):
|
||||
return self._output_dir / name
|
||||
|
||||
def _new_name(self) -> str:
|
||||
return f"{self._obj_class_name}_{uuid_string()}"
|
||||
tid = threading.current_thread().ident
|
||||
return f"{self._obj_class_name}_{tid}_{uuid_string()}"
|
||||
|
||||
def _tempdir_cleanup(self) -> None:
|
||||
"""Calls `cleanup` on the temporary directory, if it exists."""
|
||||
|
Loading…
Reference in New Issue
Block a user