-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix ThreadPool::with_name warning #10
Open
robbinhan
wants to merge
8
commits into
snowplow-archive:master
Choose a base branch
from
robbinhan:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2f2e3dd
fix ThreadPool::with_name warning
robbinhan 153d6fa
update consul depency and fix consul set & get key
robbinhan 6ae1de2
fix consual client 'post method not allow error'
db9c15c
add feature: the check api response exec_output feild
robbinhan 5f645b6
update depends and add JobRequest object two fields : start_time,end_…
robbinhan 2aaa7ae
add submit/new api for resubmit task
robbinhan 9da468e
fix Remove duplicate Factotum factfile arguments #1(https://github.co…
robbinhan f773484
delete factotum binary
robbinhan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ use iron::typemap::Key; | |
use logger::Logger; | ||
use persistent::{Read, State}; | ||
use threadpool::ThreadPool; | ||
use chrono::prelude::Utc; | ||
|
||
use Args; | ||
use factotum_server::command::{CommandStore, Execution}; | ||
|
@@ -83,6 +84,7 @@ pub fn start(args: Args) -> Result<(), String> { | |
status: get "/status" => responder::status, | ||
settings: post "/settings" => responder::settings, | ||
submit: post "/submit" => responder::submit, | ||
submit_new: post "/submit/new" => responder::submit, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes the same task wants to execute multiple times, and you need to know the results of the run. |
||
check: get "/check" => responder::check | ||
); | ||
let (logger_before, logger_after) = Logger::new(None); | ||
|
@@ -113,7 +115,7 @@ pub fn start(args: Args) -> Result<(), String> { | |
|
||
pub fn trigger_worker_manager<T: 'static + Clone + Persistence + Send>(dispatcher: Dispatcher, persistence: T, command_store: &CommandStore) -> Result<(Sender<Dispatch>, JoinHandle<()>, ThreadPool), String> { | ||
let (tx, rx) = mpsc::channel(); | ||
let primary_pool = ThreadPool::new_with_name("primary_pool".to_string(), dispatcher.max_workers); | ||
let primary_pool = ThreadPool::with_name("primary_pool".to_string(), dispatcher.max_workers); | ||
|
||
let join_handle = spawn_worker_manager(tx.clone(), rx, dispatcher.requests_queue, dispatcher.max_jobs, primary_pool.clone(), persistence, command_store.clone()); | ||
|
||
|
@@ -227,8 +229,11 @@ fn process_job_request<T: 'static + Persistence + Send>(requests_channel: Sender | |
cmd_args.extend_from_slice(request.factfile_args.as_slice()); | ||
match command_store.execute(cmd_path, cmd_args) { | ||
Ok(output) => { | ||
trace!("{}", output); | ||
requests_channel.send(Dispatch::RequestComplete(request)).expect("Job requests channel receiver has been deallocated"); | ||
trace!("process_job_request output:{}", output); | ||
let mut clone = request.clone(); | ||
clone.exec_output = output; | ||
clone.end_time = Utc::now(); | ||
requests_channel.send(Dispatch::RequestComplete(clone)).expect("Job requests channel receiver has been deallocated"); | ||
}, | ||
Err(e) => { | ||
error!("{}", e); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we depend on a specific version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
chrono
need new version and some packages need to update togetherconsul
client is not support new consul serverThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, factotum binary is my mistake, I will delete it.