מה בדיוק קורה כשמפעילים סגירה אוטומטית?

נניח שיש לך הרבה פוסטים ישנים מאוד שיעמדו בתנאים להיסגר אוטומטית ברגע שתפעיל את ההגדרה הזו עבור קטגוריה. כאשר אתה מפעיל את ההגדרה, נניח, לסגור פוסטים אוטומטית לאחר 5 שנים ללא פעילות, מתי כל הפוסטים האלה ייסגרו אוטומטית? מיד כשאתה לוחץ על שמירה? או שיש איזשהו ניקוי אוטומטי שמתרחש ברקע. האם זה צפוי לגרום לבעיות ביצועים?

והשאלה השנייה, האם פוסטים שנסגרו אוטומטית נפתחים מחדש אם משנים את הזמן בקטגוריה? אני מניח שלא. אני גם מניח שאין דרך קלה דרך הממשק לפתוח מחדש בכמות גדולה. האם זה נכון?

  • By default, the auto-close setting on a category only applies to newly created topics.
  • Existing topics are not auto-closed as soon as you save the setting. They will remain open unless you explicitly apply the auto-close to them.
  • There is a dedicated script (rake topics:apply_autoclose) that can be run via the server console to apply the auto-close timer to existing topics. This script silently closes qualifying topics (those old enough, based on your setting), minimizing notifications.
  • Applying the setting to all old topics at once using the script is a background operation. If you have a very large community and many old topics, it may take some time, but it runs server-side. Performance impact varies depending on hosting and topic count, but the rake task is designed for bulk actions and should not severely affect healthy, well-provisioned Discourse sites.
  • Discussion on the same is here:
  • Changing the auto-close time does NOT reopen topics that were already closed (i.e., closure is not reversed).
  • There is no built-in user interface option to bulk re-open closed topics.
  • However, you can use a script or a Rails console command to reopen topics in bulk.
Topic.where(closed: true).where("created_at < 'your_date'").find_each do |topic|
  topic.update_status('closed', false, Discourse.system_user)
end
3 לייקים

תודה רבה. אני נשבע שחיפשתי, אבל לא ראיתי את הפוסט שציטטת.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.