Prevent unneeded updates
This commit is contained in:
@@ -213,7 +213,6 @@ class ChristmasBot:
|
|||||||
now = time.time()
|
now = time.time()
|
||||||
if now - self.last_dashboard_update < config.update_post_interval: return
|
if now - self.last_dashboard_update < config.update_post_interval: return
|
||||||
|
|
||||||
print("📝 Updating Forest Dashboard...")
|
|
||||||
data = self.db.get_forest_data()
|
data = self.db.get_forest_data()
|
||||||
|
|
||||||
if self.last_updated_data and self.last_updated_data == data:
|
if self.last_updated_data and self.last_updated_data == data:
|
||||||
@@ -221,6 +220,8 @@ class ChristmasBot:
|
|||||||
print(f"No change in dashboard, last checked {now}...", end="\r")
|
print(f"No change in dashboard, last checked {now}...", end="\r")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
print("📝 Updating Forest Dashboard...")
|
||||||
|
|
||||||
body = "# 🎄 The Christmas Forest 🎄\n\n"
|
body = "# 🎄 The Christmas Forest 🎄\n\n"
|
||||||
body += "### How to Participate:\n"
|
body += "### How to Participate:\n"
|
||||||
body += "1. Send a DM to u/{}\n".format(config.username)
|
body += "1. Send a DM to u/{}\n".format(config.username)
|
||||||
|
|||||||
Reference in New Issue
Block a user