Skip to content

Commit

Permalink
fix: config is no longer erased when it fails to save. Also, the conf…
Browse files Browse the repository at this point in the history
…ig is saved synchronously now
  • Loading branch information
vanutp committed May 6, 2024
1 parent 16d3830 commit df539a3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tgpy/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,8 @@ def load(self):
except FileNotFoundError:
self.__data = {}

def _save(self):
with open(CONFIG_FILENAME, 'w') as file:
yaml.safe_dump(self.__data, file)

def save(self):
Thread(target=self._save).start()
CONFIG_FILENAME.write_text(yaml.safe_dump(self.__data))


config = Config()
Expand Down

0 comments on commit df539a3

Please sign in to comment.