DEV: Improve external upload debugging (#28627)

* Do not delete created external upload stubs for 2 days
  instead of 1 hour if enable_upload_debug_mode is true,
  this aids with server-side debugging.
* If using an API call, return the detailed error message
  if enable_upload_debug_mode is true. In this case the user
  is not using the UI, so a more detailed message is appropriate.
* Add a prefix to log messages in ExternalUploadHelpers, to
  make it easier to find these in logster.
This commit is contained in:
Martin Brennan
2024-08-30 10:25:04 +10:00
committed by GitHub
parent a874ac71bc
commit daa06a1c00
3 changed files with 48 additions and 17 deletions

View File

@ -21,7 +21,7 @@ class ExternalUploadStub < ActiveRecord::Base
where(
"status = ? AND created_at <= ?",
ExternalUploadStub.statuses[:created],
CREATED_EXPIRY_HOURS.hours.ago,
(SiteSetting.enable_upload_debug_mode ? 48 : CREATED_EXPIRY_HOURS).hours.ago,
)
end