1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

fix: truncate output and details in deliveries to 250 characters

closes #2831
هذا الالتزام موجود في:
Adam Cooke
2024-03-01 13:14:48 +00:00
الأصل 18ba7140b4
التزام 694240ddcd

عرض الملف

@@ -7,7 +7,14 @@ module Postal
def self.create(message, attributes = {})
attributes = message.database.stringify_keys(attributes)
attributes = attributes.merge("message_id" => message.id, "timestamp" => Time.now.to_f)
# Ensure that output and details don't overflow their columns. We don't need
# these values to store more than 250 characters.
attributes["output"] = attributes["output"][0, 250] if attributes["output"]
attributes["details"] = attributes["details"][0, 250] if attributes["details"]
id = message.database.insert("deliveries", attributes)
delivery = Delivery.new(message, attributes.merge("id" => id))
delivery.update_statistics
delivery.send_webhooks