Skip to content

Commit

Permalink
💩 remove forced flush
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarabout committed Feb 15, 2024
1 parent 5f5f11f commit 7a5cc8f
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions taipy/core/_repository/_filesystem_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import copy
import json
import os
import pathlib
import shutil
from typing import Any, Dict, Iterable, Iterator, List, Optional, Type, Union
Expand Down Expand Up @@ -62,14 +61,10 @@ def _storage_folder(self) -> pathlib.Path:
def _save(self, entity: Entity):
self.__create_directory_if_not_exists()
model = self.converter._entity_to_model(entity) # type: ignore
# fd = self.__get_path(model.id).write_text(
# json.dumps(model.to_dict(), ensure_ascii=False, indent=0, cls=_Encoder, check_circular=False),
# encoding="UTF-8",
# )
with open(self.__get_path(model.id), "w", encoding="utf-8") as f:
f.write(json.dumps(model.to_dict(), ensure_ascii=False, indent=0, cls=_Encoder, check_circular=False))
f.flush()
os.fsync(f.fileno())
self.__get_path(model.id).write_text(
json.dumps(model.to_dict(), ensure_ascii=False, indent=0, cls=_Encoder, check_circular=False),
encoding="UTF-8",
)

def _exists(self, entity_id: str) -> bool:
return self.__get_path(entity_id).exists()
Expand Down

0 comments on commit 7a5cc8f

Please sign in to comment.