@@ -37,7 +37,7 @@ async fn handle_pull_request(
3737 payload. pull_request . number ,
3838 ) ;
3939
40- handle_pull ( payload, job_sender, check_run) . await ?;
40+ let num_icons = handle_pull ( payload, job_sender, check_run) . await ?;
4141
4242 if let Some ( ref pool) = pool {
4343 let mut conn = match pool. get_conn ( ) . await {
@@ -54,20 +54,23 @@ async fn handle_pull_request(
5454 check_id,
5555 repo_id,
5656 pr_number,
57- merge_date
57+ merge_date,
58+ num_icons
5859 )
5960 VALUES(
6061 :check_id,
6162 :repo_id,
6263 :pr_number,
63- :merge_date
64+ :merge_date,
65+ :num_icons
6466 )
6567 " ,
6668 params ! {
6769 "check_id" => check_id,
6870 "repo_id" => repo_id,
6971 "pr_number" => pr_number,
70- "merge_date" => None :: <time:: PrimitiveDateTime >,
72+ "merge_date" => None :: <usize >,
73+ "num_icons" => num_icons,
7174 } ,
7275 )
7376 . await
@@ -88,14 +91,13 @@ async fn handle_pull_request(
8891 } ;
8992
9093 let now = time:: OffsetDateTime :: now_utc ( ) ;
91- let now = time:: PrimitiveDateTime :: new ( now. date ( ) , now. time ( ) ) ;
9294 if let Err ( e) = conn
9395 . exec_drop (
9496 r"UPDATE jobs SET merge_date=:date
9597 WHERE repo_id=:rp_id
9698 AND pr_number=:pr_num" ,
9799 params ! {
98- "date" => now,
100+ "date" => mysql_async :: Value :: Date ( now. year ( ) as u16 , now . month ( ) as u8 , now . day ( ) , now . hour ( ) , now . minute ( ) , now . second ( ) , now . microsecond ( ) ) ,
99101 "rp_id" => payload. repository. id,
100102 "pr_num" => payload. pull_request. number,
101103 } ,
@@ -115,7 +117,7 @@ async fn handle_pull(
115117 payload : PullRequestEventPayload ,
116118 job_sender : DataJobSender ,
117119 check_run : CheckRun ,
118- ) -> Result < ( ) > {
120+ ) -> Result < usize > {
119121 if payload
120122 . pull_request
121123 . title
@@ -131,7 +133,7 @@ async fn handle_pull(
131133 } ;
132134
133135 check_run. mark_skipped ( output) . await ?;
134- return Ok ( ( ) ) ;
136+ return Ok ( 0 ) ;
135137 }
136138
137139 let conf = & crate :: CONFIG . get ( ) . unwrap ( ) ;
@@ -149,7 +151,7 @@ async fn handle_pull(
149151
150152 check_run. mark_skipped ( output) . await ?;
151153
152- return Ok ( ( ) ) ;
154+ return Ok ( 0 ) ;
153155 }
154156
155157 let files = get_pull_files (
@@ -170,6 +172,8 @@ async fn handle_pull(
170172 } )
171173 . collect ( ) ;
172174
175+ let num_icons_diffed = changed_dmis. len ( ) ;
176+
173177 if changed_dmis. is_empty ( ) {
174178 let output = Output {
175179 title : "No icon changes" ,
@@ -179,7 +183,7 @@ async fn handle_pull(
179183
180184 check_run. mark_skipped ( output) . await ?;
181185
182- return Ok ( ( ) ) ;
186+ return Ok ( 0 ) ;
183187 }
184188
185189 check_run. mark_queued ( ) . await ?;
@@ -199,7 +203,7 @@ async fn handle_pull(
199203
200204 job_sender. send_async ( job) . await ?;
201205
202- Ok ( ( ) )
206+ Ok ( num_icons_diffed )
203207}
204208
205209#[ actix_web:: post( "/payload" ) ]
0 commit comments