fix export large set of bulletin overflow issue

This commit is contained in:
chiu 2023-09-13 14:04:15 +00:00
parent 76a1f819c9
commit 0754bfad3e
1 changed files with 1 additions and 1 deletions

View File

@ -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)