mirror of
https://github.com/Death916/deathclock.git
synced 2026-04-10 03:04:40 -07:00
remove news writing to disk to save pi sd card writes
This commit is contained in:
parent
7887a60e67
commit
e70a79a41a
1 changed files with 0 additions and 10 deletions
|
|
@ -100,14 +100,4 @@ class News:
|
|||
if len(all_entries) > 30:
|
||||
all_entries = random.sample(all_entries, 30)
|
||||
|
||||
try:
|
||||
async with aiofiles.open("news.txt", "w") as f:
|
||||
print("Writing news to file...")
|
||||
for entry in all_entries:
|
||||
await f.write(
|
||||
f"[{entry['publish_date']}] {entry['source']}: {entry['title']}\n"
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"Error writing to news.txt: {e}")
|
||||
|
||||
return all_entries
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue