}
INFO(daemon->ctx, "Will attempt to reconnect in %u second(s)\n",
- daemon->reconnect_holdoff / 1000000);
+ daemon->reconnect_holdoff / S_TO_US(1));
// Set the reconnection timer
r = sd_event_source_set_time_relative(daemon->connect_timer, daemon->reconnect_holdoff);
daemon->reconnect_holdoff *= 2;
// Cap reconnection attempts to every minute
- if (daemon->reconnect_holdoff > 60000000)
- daemon->reconnect_holdoff = 60000000;
+ if (daemon->reconnect_holdoff > S_TO_US(60))
+ daemon->reconnect_holdoff = S_TO_US(60);
// Disable sending stats until we are connected
r = sd_event_source_set_enabled(daemon->stats_timer, SD_EVENT_OFF);
daemon->control = pakfire_xfer_ref(xfer);
// Reset the holdoff timer
- daemon->reconnect_holdoff = 1000000;
+ daemon->reconnect_holdoff = S_TO_US(1);
// Submit stats continuously
r = sd_event_source_set_enabled(daemon->stats_timer, SD_EVENT_ON);
}
// Refresh one hour before the expiry time
- uint64_t t_refresh = (t_end - 3600) * 1000000;
+ uint64_t t_refresh = (t_end - 3600) * S_TO_US(1);
// Authenticate again just before the credentials expire
r = sd_event_source_set_time(daemon->auth_timer, t_refresh);
goto ERROR;
// Reconnect after one second
- d->reconnect_holdoff = 1000000;
+ d->reconnect_holdoff = S_TO_US(1);
// Return the pointer
*daemon = d;