Compare commits
10 Commits
213f174ffe
...
0ec606cdaa
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ec606cdaa | |||
| 2b2faa70ea | |||
| 7cbd373742 | |||
| 45393e3a15 | |||
| 8e0a158ac9 | |||
| 6736d1ce4f | |||
| 43fdb59dbf | |||
| 7f612bfc17 | |||
| 93290da5b5 | |||
| 9f4897a5b8 |
@ -271,18 +271,24 @@ class ChatDB(Chat):
|
||||
self.messages += new_messages
|
||||
self.sort()
|
||||
|
||||
def write_db(self) -> None:
|
||||
def write_db(self, msgs: Optional[list[Message]] = None) -> None:
|
||||
"""
|
||||
Write all messages to the DB directory. If a message has no file_path,
|
||||
a new one will be created. If message.file_path exists, it will be modified
|
||||
to point to the DB directory.
|
||||
Write messages to the DB directory. If a message has no file_path, a new one
|
||||
will be created. If message.file_path exists, it will be modified to point
|
||||
to the DB directory.
|
||||
"""
|
||||
write_dir(self.db_path, self.messages, self.file_suffix, self.get_next_fid)
|
||||
write_dir(self.db_path,
|
||||
msgs if msgs else self.messages,
|
||||
self.file_suffix,
|
||||
self.get_next_fid)
|
||||
|
||||
def write_cache(self) -> None:
|
||||
def write_cache(self, msgs: Optional[list[Message]] = None) -> None:
|
||||
"""
|
||||
Write all messages to the cache directory. If a message has no file_path,
|
||||
a new one will be created. If message.file_path exists, it will be modified
|
||||
to point to the cache directory.
|
||||
Write messages to the cache directory. If a message has no file_path, a new one
|
||||
will be created. If message.file_path exists, it will be modified to point to
|
||||
the cache directory.
|
||||
"""
|
||||
write_dir(self.cache_path, self.messages, self.file_suffix, self.get_next_fid)
|
||||
write_dir(self.cache_path,
|
||||
msgs if msgs else self.messages,
|
||||
self.file_suffix,
|
||||
self.get_next_fid)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user