Server tools to backfill, tail, mirror, and verify PLC logs
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

plc_rocksdb: actually compress and read the right way ffs

geesawra 7b95096b f83f5f5f

+7 -6
+7 -6
src/plc_rocksdb.rs
··· 126 126 impl RocksOp { 127 127 async fn from_op(op: &Op) -> Self { 128 128 let op_str = op.operation.to_string().into_bytes(); 129 - let mut gz = GzipEncoder::new(op_str); 130 - let op_gz = vec![]; 131 - gz.write_all(&op_gz).await.unwrap(); 129 + let mut gz = GzipEncoder::new(Vec::new()); 130 + gz.write_all(&op_str).await.unwrap(); 132 131 gz.flush().await.unwrap(); 132 + let op_gz = gz.into_inner(); 133 133 134 134 Self { 135 135 operation: op_gz, ··· 141 141 } 142 142 143 143 async fn to_op(&self) -> Op { 144 - let mut dec = GzipDecoder::new(self.operation.clone()); 145 - let dec_op = vec![]; 146 - dec.write_all(&dec_op).await.unwrap(); 144 + let mut dec_op = Vec::new(); 145 + let mut dec = GzipDecoder::new(&mut dec_op); 146 + dec.write_all(&self.operation).await.unwrap(); 147 147 dec.flush().await.unwrap(); 148 148 let dec_op = String::from_utf8(dec_op).unwrap(); 149 149 ··· 264 264 } 265 265 266 266 let rop: RocksOp = serde_json::from_slice(&v).unwrap(); 267 + 267 268 Some(rop) 268 269 }) 269 270 .collect();