Skip to content

Commit

Permalink
fix(versionup): use latest oauth2 lib
Browse files Browse the repository at this point in the history
It enables using std::time::Duration natively
  • Loading branch information
Byron committed Jan 30, 2016
1 parent ef9e7f1 commit a2c6b58
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/mako/Cargo.toml.mako
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ hyper = "0.7"
mime = "0.1.0"
serde = ">= 0.6.0"
serde_json = ">= 0.6.0"
yup-oauth2 = "0.5"
yup-oauth2 = ">= 0.5.4"
% for dep in cargo.get('dependencies', list()):
${dep}
% endfor
Expand Down
4 changes: 2 additions & 2 deletions src/mako/api/lib/mbuild.mako
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ else {
match req_result {
Err(err) => {
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
sleep(Duration::from_millis(d.num_milliseconds() as u64));
sleep(d);
continue;
}
${delegate_finish}(false);
Expand All @@ -785,7 +785,7 @@ else {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep(Duration::from_millis(d.num_milliseconds() as u64));
sleep(d);
continue;
}
${delegate_finish}(false);
Expand Down
2 changes: 1 addition & 1 deletion src/mako/deps.mako
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ help${agsuffix}:
%>\
${fake_target}:
@mkdir -p ${target_dir}
@wget -nv ${info['discoveryRestUrl']} -O ${target}
@-wget -nv ${info['discoveryRestUrl']} -O ${target}
% endfor

update-json: ${' '.join(json_api_targets)}
Expand Down
8 changes: 4 additions & 4 deletions src/rust/api/cmn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ impl<'a, A> ResumableUploadHelper<'a, A>
Some(hh) if r.status == StatusCode::PermanentRedirect => hh,
None|Some(_) => {
if let Retry::After(d) = self.delegate.http_failure(&r, None, None) {
sleep(Duration::from_millis(d.num_milliseconds() as u64));
sleep(d);
continue;
}
return Err(Ok(r))
Expand All @@ -666,7 +666,7 @@ impl<'a, A> ResumableUploadHelper<'a, A>
}
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep(Duration::from_millis(d.num_milliseconds() as u64));
sleep(d);
continue;
}
return Err(Err(err))
Expand Down Expand Up @@ -727,15 +727,15 @@ impl<'a, A> ResumableUploadHelper<'a, A>
if let Retry::After(d) = self.delegate.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep(Duration::from_millis(d.num_milliseconds() as u64));
sleep(d);
continue;
}
}
return Some(Ok(res))
},
Err(err) => {
if let Retry::After(d) = self.delegate.http_error(&err) {
sleep(Duration::from_millis(d.num_milliseconds() as u64));
sleep(d);
continue;
}
return Some(Err(err))
Expand Down

0 comments on commit a2c6b58

Please sign in to comment.