ryerraguntla commented on code in PR #3140:
URL: https://github.com/apache/iggy/pull/3140#discussion_r3232908836


##########
core/connectors/sinks/influxdb_sink/src/lib.rs:
##########
@@ -443,33 +543,27 @@ impl InfluxDbSink {
                 buf.push('"');
             }
             PayloadFormat::Text => {
-                let payload_bytes = message.payload.try_to_bytes().map_err(|e| 
{
-                    Error::CannotStoreData(format!("Failed to convert payload 
to bytes: {e}"))
+                let bytes = message.payload.try_to_bytes().map_err(|e| {
+                    Error::CannotStoreData(format!("Payload conversion failed: 
{e}"))
                 })?;
-                let text = String::from_utf8(payload_bytes).map_err(|e| {
-                    Error::CannotStoreData(format!(
-                        "Payload format is text but payload is invalid UTF-8: 
{e}"
-                    ))
+                let text = String::from_utf8(bytes).map_err(|e| {
+                    Error::CannotStoreData(format!("Payload is not valid 
UTF-8: {e}"))
                 })?;
                 buf.push_str(",payload_text=\"");
                 write_field_string(buf, &text);
                 buf.push('"');
             }
             PayloadFormat::Base64 => {
-                let payload_bytes = message.payload.try_to_bytes().map_err(|e| 
{
-                    Error::CannotStoreData(format!("Failed to convert payload 
to bytes: {e}"))
+                let bytes = message.payload.try_to_bytes().map_err(|e| {
+                    Error::CannotStoreData(format!("Payload conversion failed: 
{e}"))
                 })?;
-                let encoded = general_purpose::STANDARD.encode(&payload_bytes);
+                let encoded = general_purpose::STANDARD.encode(&bytes);
                 buf.push_str(",payload_base64=\"");
                 write_field_string(buf, &encoded);
                 buf.push('"');
             }
         }
 
-        // ── Timestamp 
────────────────────────────────────────────────────────
-        // message.timestamp is microseconds since Unix epoch.
-        // Fall back to now() when unset (0) so points are not stored at the
-        // Unix epoch (year 1970), which falls outside every range(start:-1h).
         let base_micros = if message.timestamp == 0 {

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to