(
&mut self,
task: &ExecutionTask,
array_id: &ArrayId,
audit_retain_ms: Option<i64>,
)
| 113 | } |
| 114 | |
| 115 | pub(in crate::data::executor) fn handle_array_compact( |
| 116 | &mut self, |
| 117 | task: &ExecutionTask, |
| 118 | array_id: &ArrayId, |
| 119 | audit_retain_ms: Option<i64>, |
| 120 | ) -> Response { |
| 121 | let now_ms = std::time::SystemTime::now() |
| 122 | .duration_since(std::time::UNIX_EPOCH) |
| 123 | .map(|d| d.as_millis() as i64) |
| 124 | .unwrap_or(0); |
| 125 | let merged = match self |
| 126 | .array_engine |
| 127 | .maybe_compact(array_id, audit_retain_ms, now_ms) |
| 128 | { |
| 129 | Ok(m) => m, |
| 130 | Err(e) => { |
| 131 | return self.response_error( |
| 132 | task, |
| 133 | ErrorCode::Internal { |
| 134 | detail: format!("array compact: {e}"), |
| 135 | }, |
| 136 | ); |
| 137 | } |
| 138 | }; |
| 139 | encode_count_response(self, task, "compacted", usize::from(merged)) |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | fn encode_count_response(core: &CoreLoop, task: &ExecutionTask, key: &str, n: usize) -> Response { |
no test coverage detected