fix export large set of bulletin overflow issue

This commit is contained in:
chiu committed 2023-09-13 14:04:15 +00:00
1 parent 76a1f819c9
commit 0754bfad3e
1 file changed
+1 -1
@@ -186,7 +186,7 @@ class Admin::AnnouncementsController < OrbitAdminController
end
Thread.new do
begin
@announcements = Bulletin.all.desc(:created_at)
@announcements = Bulletin.all.desc(:id)
last_updated = [Bulletin.max(:updated_at).to_i, AnnouncementSetting.max(:updated_at).to_i].max
filename = "public/announcement_export_#{last_updated}.xlsx"
if File.exist?(filename)