Skip to content

Commit

Permalink
mononoke/git: make git-pool use tokio_shim
Browse files Browse the repository at this point in the history
Summary: This is used in Metagit and I'd like to decouple those 2 Tokio 1.x migrations.

Reviewed By: HarveyHunt

Differential Revision: D26813352

fbshipit-source-id: 7bc34e1cad00c83bf66edce559b07104d44a7357
  • Loading branch information
krallin authored and facebook-github-bot committed Mar 4, 2021
1 parent ce016a1 commit 734ea4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion eden/mononoke/git/git-pool/Cargo.toml
Expand Up @@ -9,4 +9,4 @@ license = "GPLv2+"
anyhow = "1.0"
git2 = "0.13"
r2d2 = "0.8.8"
tokio = { version = "0.2.25", features = ["full", "test-util"] }
tokio_shim = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
3 changes: 1 addition & 2 deletions eden/mononoke/git/git-pool/src/lib.rs
Expand Up @@ -10,7 +10,6 @@ use anyhow::{anyhow, Error};
use git2::{Error as Git2Error, Repository};
use r2d2::{ManageConnection, Pool};
use std::path::PathBuf;
use tokio::task;

#[derive(Debug, Clone)]
pub struct GitPool {
Expand All @@ -33,7 +32,7 @@ impl GitPool {
{
let pool = self.pool.clone();

let ret = task::spawn_blocking(move || {
let ret = tokio_shim::task::spawn_blocking(move || {
let result_repo = pool.get()?;
let repo = match &*result_repo {
Ok(repo) => repo,
Expand Down

0 comments on commit 734ea4d

Please sign in to comment.