mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-07 07:36:58 +00:00
Add fallback report loading in case websockets fail
This also resolves a race condition scenario. Even if the report gets rendered via websockets before the controller response is rendered then the fallback script loads the report again. It's not the most beautiful but probably okay until we replace websockts altogether. I'm leaving websockets in at the moment because it can render the report much quicker than polling can.
This commit is contained in:
@@ -58,12 +58,12 @@ module Admin
|
||||
end
|
||||
|
||||
def render_in_background
|
||||
blob = ReportBlob.create_for_upload_later!(report_filename)
|
||||
@blob = ReportBlob.create_for_upload_later!(report_filename)
|
||||
|
||||
ReportJob.perform_later(
|
||||
report_class:, user: spree_current_user, params:,
|
||||
format: report_format,
|
||||
blob:,
|
||||
blob: @blob,
|
||||
channel: ScopedChannel.for_id(params[:uuid]),
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user