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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user