fix: Remove misleading os.O_NONBLOCK flag (#28859)

This works likes this in C `open(2)` on file descriptor, not in python :)

In python it's setting buffering to enum value which in this case is
2048, if it were lower number this would've made performance worse.

ref:
- https://man7.org/linux/man-pages/man2/open.2.html#DESCRIPTION
- https://docs.python.org/3/library/functions.html#open
This commit is contained in:
Ankush Menat 2024-12-23 10:52:13 +05:30 committed by GitHub
parent df7c8b1f88
commit e85aa44843
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -127,7 +127,7 @@ def flush():
logs = frappe.cache.lrange(MONITOR_REDIS_KEY, 0, -1)
if logs:
logs = list(map(frappe.safe_decode, logs))
with open(log_file(), "a", os.O_NONBLOCK) as f:
with open(log_file(), "a") as f:
f.write("\n".join(logs))
f.write("\n")
# Remove fetched entries from cache