@@ -57,6 +57,14 @@ func (c *client) Run(req gqlclient.Request, resp interface{}) error {
5757const fetchCommitCacheExpiry = time .Hour * 12
5858
5959func (b * BuildPlanner ) FetchCommit (commitID strfmt.UUID , owner , project string , target * string ) (* Commit , error ) {
60+ return b .fetchCommit (commitID , owner , project , target , true )
61+ }
62+
63+ func (b * BuildPlanner ) FetchCommitNoPoll (commitID strfmt.UUID , owner , project string , target * string ) (* Commit , error ) {
64+ return b .fetchCommit (commitID , owner , project , target , false )
65+ }
66+
67+ func (b * BuildPlanner ) fetchCommit (commitID strfmt.UUID , owner , project string , target * string , poll bool ) (* Commit , error ) {
6068 logging .Debug ("FetchCommit, commitID: %s, owner: %s, project: %s" , commitID , owner , project )
6169 resp := & response.ProjectCommitResponse {}
6270
@@ -92,7 +100,7 @@ func (b *BuildPlanner) FetchCommit(commitID strfmt.UUID, owner, project string,
92100 // The BuildPlanner will return a build plan with a status of
93101 // "planning" if the build plan is not ready yet. We need to
94102 // poll the BuildPlanner until the build is ready.
95- if resp .Project .Commit .Build .Status == raw .Planning {
103+ if poll && resp .Project .Commit .Build .Status == raw .Planning {
96104 resp .Project .Commit .Build , err = b .pollBuildPlanned (commitID .String (), owner , project , target )
97105 if err != nil {
98106 return nil , errs .Wrap (err , "failed to poll build plan" )
0 commit comments