Add get_error method to client for standardized error retrieval

- Implemented get_error() method to fetch job error messages from Redis
- Mirrors get_result() pattern for consistency
- Used by supervisor to retrieve job errors without manual Redis queries
- Cleanup: removed old runner_osis directory
This commit is contained in:
Timur Gordon
2025-10-28 03:32:57 +01:00
parent 268128f7fd
commit 0c918a8f5f
9 changed files with 43 additions and 295 deletions

View File

@@ -312,6 +312,21 @@ impl Client {
Ok(result)
}
/// Get job result from Redis
pub async fn get_error(
&self,
job_id: &str,
) -> Result<Option<String>, JobError> {
let job_key = self.job_key(job_id);
let mut conn = self.redis_client
.get_multiplexed_async_connection()
.await
.map_err(|e| JobError::Redis(e))?;
let result: Option<String> = conn.hget(&job_key, "error").await
.map_err(|e| JobError::Redis(e))?;
Ok(result)
}
/// Get a job ID from the work queue (blocking pop)
pub async fn get_job_id(&self, queue_key: &str) -> Result<Option<String>, JobError> {
let mut conn = self.redis_client