pub async fn as_influx_push(&self, influx: &influx::Client, github: &Github) {
        let repo = &self.repository;

        for commit in &self.commits {
            if commit.distinct {
                let c = github.repo(repo.owner.login.to_string(), repo.name.to_string()).commits().get(&commit.id).await.unwrap();

                if c.sha != commit.id {
                    // We have a problem.
                    sentry::capture_message(&format!("commit sha mismatch: {} {}", c.sha, commit.id), sentry::Level::Fatal);
                    return;
                }

                let push_event = influx::Push {
                    time: c.commit.author.date,
                    repo_name: repo.name.to_string(),
                    sender: self.sender.login.to_string(),
                    reference: self.refv.to_string(),
                    added: commit.added.join(",").to_string(),
                    modified: commit.removed.join(",").to_string(),
                    removed: commit.removed.join(",").to_string(),
                    sha: c.sha.to_string(),
                    additions: c.stats.additions,
                    deletions: c.stats.deletions,
                    total: c.stats.total,
                    message: c.commit.message.to_string(),
                };

                influx.query(push_event, EventType::Push.name()).await;
            }
        }
    }
// Push an event for every commit.
Push an event for every commit.
Push an event for every commit .
pub async fn as_influx_push(&self, influx: &influx::Client, github: &Github) {
        let repo = &self.repository;
        for commit in &self.commits {
            if commit.distinct {
                let c = github.repo(repo.owner.login.to_string(), repo.name.to_string()).commits().get(&commit.id).await.unwrap();
                if c.sha != commit.id {
                    // We have a problem.
                    sentry::capture_message(&format!("commit sha mismatch: {} {}", c.sha, commit.id), sentry::Level::Fatal);
                    return;
                }
                let push_event = influx::Push {
                    time: c.commit.author.date,
                    repo_name: repo.name.to_string(),
                    sender: self.sender.login.to_string(),
                    reference: self.refv.to_string(),
                    added: commit.added.join(",").to_string(),
                    modified: commit.removed.join(",").to_string(),
                    removed: commit.removed.join(",").to_string(),
                    sha: c.sha.to_string(),
                    additions: c.stats.additions,
                    deletions: c.stats.deletions,
                    total: c.stats.total,
                    message: c.commit.message.to_string(),
                };
                influx.query(push_event, EventType::Push.name()).await;
            }
        }
    }
pub async fn as_influx_push ( & self , influx : & influx :: Client , github : & Github ) { let repo = & self . repository ; for commit in & self . commits { if commit . distinct { let c = github . repo ( repo . owner . login . to_string ( ) , repo . name . to_string ( ) ) . commits ( ) . get ( & commit . id ) . await . unwrap ( ) ; if c . sha != commit . id { // We have a problem. sentry :: capture_message ( & format ! ( " " c sha commit id ) , sentry :: Level :: Fatal ) ; return ; } let push_event = influx :: Push { time : c . commit . author . date , repo_name : repo . name . to_string ( ) , sender : self . sender . login . to_string ( ) , reference : self . refv . to_string ( ) , added : commit . added . join ( " " ) . to_string ( ) , modified : commit . removed . join ( " " ) . to_string ( ) , removed : commit . removed . join ( " " ) . to_string ( ) , sha : c . sha . to_string ( ) , additions : c . stats . additions , deletions : c . stats . deletions , total : c . stats . total , message : c . commit . message . to_string ( ) , } ; influx . query ( push_event , EventType :: Push . name ( ) ) . await ; } } }
Push an event for every commit.
Push an event for every commit .
&self
influx
&influx::Client
github
&Github
&self
influx
&influx::Client
github
&Github