Просмотр исходного кода

try create instead of create_lazy

Falko Schindler 1 месяц назад
Родитель
Сommit
40d781417e
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      nicegui/persistence/file_persistent_dict.py

+ 1 - 1
nicegui/persistence/file_persistent_dict.py

@@ -51,7 +51,7 @@ class FilePersistentDict(PersistentDict):
             async with aiofiles.open(self.filepath, 'w', encoding=self.encoding) as f:
                 await f.write(json.dumps(self, indent=self.indent))
         if core.loop:
-            task = background_tasks.create_lazy(async_backup(), name=self.filepath.stem)
+            task = background_tasks.create(async_backup(), name=self.filepath.stem)
             if task:
                 self.backup_tasks.append(task)
                 task.add_done_callback(self.backup_tasks.remove)