@@ -280,6 +280,8 @@ async fn ngx_http_acme_update_certificates_for_issuer(
280
280
continue ;
281
281
} ;
282
282
283
+ let order_id = order. cache_key ( ) ;
284
+
283
285
{
284
286
let locked = cert. read ( ) ;
285
287
@@ -290,9 +292,8 @@ async fn ngx_http_acme_update_certificates_for_issuer(
290
292
if !locked. is_renewable ( ) {
291
293
ngx_log_debug ! (
292
294
log. as_ptr( ) ,
293
- "acme: certificate \" {}/{}\" is not due for renewal" ,
294
- issuer. name,
295
- order. cache_key( )
295
+ "acme: certificate \" {issuer}/{order_id}\" is not due for renewal" ,
296
+ issuer = issuer. name,
296
297
) ;
297
298
next = cmp:: min ( locked. next , next) ;
298
299
continue ;
@@ -324,9 +325,9 @@ async fn ngx_http_acme_update_certificates_for_issuer(
324
325
ngx_log_error ! (
325
326
NGX_LOG_INFO ,
326
327
log. as_ptr( ) ,
327
- "acme certificate \" {}/{}\" issued, next renewal in {:?}" ,
328
+ "acme certificate \" {}/{}\" issued, next update in {:?}" ,
328
329
issuer. name,
329
- order . cache_key ( ) ,
330
+ order_id ,
330
331
( x - now)
331
332
) ;
332
333
x
@@ -335,23 +336,19 @@ async fn ngx_http_acme_update_certificates_for_issuer(
335
336
ngx_log_error ! (
336
337
NGX_LOG_WARN ,
337
338
log. as_ptr( ) ,
338
- "acme certificate \" {}/{}\" request failed: {}" ,
339
- issuer. name,
340
- order. cache_key( ) ,
341
- err
339
+ "{err} while updating certificate \" {issuer}/{order_id}\" " ,
340
+ issuer = issuer. name,
342
341
) ;
343
342
now + ACME_MIN_INTERVAL
344
343
}
345
344
} ;
346
345
347
346
// Write files even if we failed to update the shared zone.
348
347
349
- let _ =
350
- issuer. write_state_file ( std:: format!( "{}.crt" , order. cache_key( ) ) , & val. chain ) ;
348
+ let _ = issuer. write_state_file ( std:: format!( "{order_id}.crt" ) , & val. chain ) ;
351
349
352
350
if !matches ! ( order. key, conf:: pkey:: PrivateKey :: File ( _) ) {
353
- let _ =
354
- issuer. write_state_file ( std:: format!( "{}.key" , order. cache_key( ) ) , & pkey) ;
351
+ let _ = issuer. write_state_file ( std:: format!( "{order_id}.key" ) , & pkey) ;
355
352
}
356
353
357
354
next
@@ -360,25 +357,22 @@ async fn ngx_http_acme_update_certificates_for_issuer(
360
357
ngx_log_error ! (
361
358
NGX_LOG_ERR ,
362
359
log. as_ptr( ) ,
363
- "acme certificate \" {}/{}\" request is not valid: {}" ,
364
- issuer. name,
365
- order. cache_key( ) ,
366
- err
360
+ "{err} while updating certificate \" {issuer}/{order_id}\" " ,
361
+ issuer = issuer. name,
367
362
) ;
368
363
cert. write ( ) . set_invalid ( & err) ;
369
364
370
365
// We marked the order as invalid and will stop attempting to update it until the
371
366
// next configuration reload. It should not affect the next update schedule.
367
+
372
368
continue ;
373
369
}
374
370
Err ( ref err) => {
375
371
ngx_log_error ! (
376
372
NGX_LOG_WARN ,
377
373
log. as_ptr( ) ,
378
- "acme certificate \" {}/{}\" request failed: {}" ,
379
- issuer. name,
380
- order. cache_key( ) ,
381
- err
374
+ "{err} while updating certificate \" {issuer}/{order_id}\" " ,
375
+ issuer = issuer. name,
382
376
) ;
383
377
cert. write ( ) . set_error ( & err)
384
378
}
0 commit comments