Back

How to make a count-down on document?

  • 1
  • Flutter
  • Databases
  • Tools
  • General
  • Cloud
electrical_eng_l
15 Nov, 2024, 22:35

I have a document that i want to archive after 24h from the moment it was created.

How do I do that ?

Also assuming my application will accept thousands of posts weekly , is there an efficient way to check and change accordingly?

The attributes :

Post - String isOnline - String DateCreated - DateTime DateEnds - DateTime

TL;DR
Create a function to fetch and archive documents after 24 hours of creation. Adjust the interval for function execution based on load. For efficient handling of high post volumes, consider optimizing the process. Solution: 1. Set up a script to run every hour to identify and archive documents created 24 hours ago. 2. Adjust the script's interval based on the application's load. 3. Optimize the archiving process to accommodate high post volumes efficiently.
Steven
15 Nov, 2024, 22:53

Have a function that runs every hour to fetch the list of documents that need to be archived and archive up to N documents. if you have a high load, you can increase the interval in which the function should run

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more