@@ -298,8 +298,8 @@ func (d *Daemon) mustInitializeStorage(cfg *config.Config) *feewindow.FeeWindows
298
298
299
299
readTxMetaCtx , cancelReadTxMeta := context .WithTimeout (context .Background (), cfg .IngestionTimeout )
300
300
defer cancelReadTxMeta ()
301
- var initialSeq uint32
302
- var currentSeq uint32
301
+
302
+ var initialSeq , currentSeq uint32
303
303
applicableRange , err := db .GetMigrationLedgerRange (readTxMetaCtx , d .db , cfg .HistoryRetentionWindow )
304
304
if err != nil {
305
305
d .logger .WithError (err ).Fatal ("could not get ledger range for migration" )
@@ -328,13 +328,11 @@ func (d *Daemon) mustInitializeStorage(cfg *config.Config) *feewindow.FeeWindows
328
328
currentSeq = txMeta .LedgerSequence ()
329
329
if initialSeq == 0 {
330
330
initialSeq = currentSeq
331
- d .logger .WithFields (supportlog.F {
332
- "seq" : currentSeq ,
333
- }).Info ("initializing in-memory store" )
331
+ d .logger .WithField ("seq" , currentSeq ).
332
+ Info ("initializing in-memory store" )
334
333
} else if (currentSeq - initialSeq )% inMemoryInitializationLedgerLogPeriod == 0 {
335
- d .logger .WithFields (supportlog.F {
336
- "seq" : currentSeq ,
337
- }).Debug ("still initializing in-memory store" )
334
+ d .logger .WithField ("seq" , currentSeq ).
335
+ Debug ("still initializing in-memory store" )
338
336
}
339
337
340
338
if err = feeWindows .IngestFees (txMeta ); err != nil {
@@ -354,18 +352,15 @@ func (d *Daemon) mustInitializeStorage(cfg *config.Config) *feewindow.FeeWindows
354
352
}
355
353
356
354
if currentSeq != 0 {
357
- d .logger .WithFields (supportlog.F {
358
- "seq" : currentSeq ,
359
- }).Info ("finished initializing in-memory store and applying DB data migrations" )
355
+ d .logger .WithField ("seq" , currentSeq ).
356
+ Info ("finished initializing in-memory store and applying DB data migrations" )
360
357
}
361
358
362
359
return feeWindows
363
360
}
364
361
365
362
func (d * Daemon ) Run () {
366
- d .logger .WithFields (supportlog.F {
367
- "addr" : d .listener .Addr ().String (),
368
- }).Info ("starting HTTP server" )
363
+ d .logger .WithField ("addr" , d .listener .Addr ().String ()).Info ("starting HTTP server" )
369
364
370
365
panicGroup := util .UnrecoverablePanicGroup .Log (d .logger )
371
366
panicGroup .Go (func () {
@@ -375,19 +370,20 @@ func (d *Daemon) Run() {
375
370
})
376
371
377
372
if d .adminServer != nil {
378
- d .logger .WithFields (supportlog. F {
379
- "addr" : d .adminListener .Addr ().String (),
380
- }). Info ("starting Admin HTTP server" )
373
+ d .logger .
374
+ WithField ( "addr" , d .adminListener .Addr ().String ()).
375
+ Info ("starting Admin HTTP server" )
381
376
panicGroup .Go (func () {
382
377
if err := d .adminServer .Serve (d .adminListener ); ! errors .Is (err , http .ErrServerClosed ) {
383
378
d .logger .WithError (err ).Error ("soroban admin server encountered fatal error" )
384
379
}
385
380
})
386
381
}
387
382
388
- // Shutdown gracefully when we receive an interrupt signal.
389
- // First server.Shutdown closes all open listeners, then closes all idle connections.
390
- // Finally, it waits a grace period (10s here) for connections to return to idle and then shut down.
383
+ // Shutdown gracefully when we receive an interrupt signal. First
384
+ // server.Shutdown closes all open listeners, then closes all idle
385
+ // connections. Finally, it waits a grace period (10s here) for connections
386
+ // to return to idle and then shut down.
391
387
signals := make (chan os.Signal , 1 )
392
388
signal .Notify (signals , syscall .SIGINT , syscall .SIGTERM )
393
389
0 commit comments