Skip to content

Commit

Permalink
Removed some old unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
spirali committed Dec 12, 2023
1 parent 1657ec0 commit 7772734
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Dev

## Breaking change

* The output format of the `job info` command with JSON output mode has been changed. Note that
the JSON output mode is still unstable.

Expand Down
25 changes: 1 addition & 24 deletions crates/hyperqueue/src/client/commands/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ use crate::client::status::{job_status, Status};
use crate::common::cli::{parse_last_all_range, parse_last_range, TaskSelectorArg};
use crate::common::utils::str::pluralize;
use crate::rpc_call;
use crate::transfer::connection::{ClientConnection, ClientSession};
use crate::transfer::connection::ClientSession;
use crate::transfer::messages::{
CancelJobResponse, CancelRequest, ForgetJobRequest, FromClientMessage, IdSelector, JobDetail,
JobDetailRequest, JobInfoRequest, TaskIdSelector, TaskSelector, TaskStatusSelector,
ToClientMessage,
};
use crate::JobId;

#[derive(Parser)]
pub struct JobListOpts {
Expand Down Expand Up @@ -107,28 +106,6 @@ pub struct JobCatOpts {
pub stream: OutputStream,
}

pub async fn get_last_job_id(connection: &mut ClientConnection) -> crate::Result<Option<JobId>> {
let message = FromClientMessage::JobInfo(JobInfoRequest {
selector: IdSelector::LastN(1),
});
let response = rpc_call!(connection, message, ToClientMessage::JobInfoResponse(r) => r).await?;

Ok(response.jobs.last().map(|job| job.id))
}

pub async fn get_job_ids(connection: &mut ClientConnection) -> crate::Result<Option<Vec<JobId>>> {
let message = FromClientMessage::JobInfo(JobInfoRequest {
selector: IdSelector::All,
});
let response = rpc_call!(connection, message, ToClientMessage::JobInfoResponse(r) => r).await?;

let mut ids: Vec<JobId> = Vec::new();
for job in response.jobs {
ids.push(job.id);
}
Ok(Option::from(ids))
}

pub async fn output_job_list(
gsettings: &GlobalSettings,
session: &mut ClientSession,
Expand Down

0 comments on commit 7772734

Please sign in to comment.