add initialization logs
This commit is contained in:
parent
780ba9eeac
commit
a822d01bd5
3 changed files with 8 additions and 2 deletions
|
@ -26,7 +26,7 @@ pub var summary_exchange: exchange.PaymentSummaryExchange = undefined;
|
|||
pub var server_settings: ServerSettings = .{};
|
||||
|
||||
pub fn init() !void {
|
||||
const total_elements_expected = 100_000;
|
||||
const total_elements_expected = 50_000;
|
||||
const alloc_payments_repository = payments.calculateNecessaryMemory(total_elements_expected);
|
||||
|
||||
heap_alocated = try std.heap.page_allocator.alloc(u8, 1024 * 100 + alloc_payments_repository);
|
||||
|
|
|
@ -15,11 +15,14 @@ pub fn main() !void {
|
|||
var post_endpoints = endpoints.EndpointsManager{};
|
||||
var put_endpoints = endpoints.EndpointsManager{};
|
||||
|
||||
std.debug.print("Init context: OK\n", .{});
|
||||
try ctx.init();
|
||||
defer ctx.deinit();
|
||||
std.debug.print("Context: OK\n", .{});
|
||||
sec.updateToken(ctx.config.initial_token);
|
||||
|
||||
try endpoints.payments.registerEndpoints(&get_endpoints, &post_endpoints);
|
||||
std.debug.print("Endpionts: OK\n", .{});
|
||||
|
||||
std.debug.print("default_pool: {d}\n", .{ctx.config.default_pool});
|
||||
std.debug.print("fallback_pool: {d}\n", .{ctx.config.fallback_pool});
|
||||
|
@ -38,6 +41,7 @@ pub fn main() !void {
|
|||
try default_service.start();
|
||||
try fallback_service.start();
|
||||
try integrator.start();
|
||||
std.debug.print("Service And Integrator: OK\n", .{});
|
||||
|
||||
ctx.payments_repository.subscribeInsert(&PaymentIntegrator.newPaymentEvent);
|
||||
|
||||
|
@ -49,9 +53,11 @@ pub fn main() !void {
|
|||
std.log.info("Server Enviroment: {}\n", .{ctx.config.env});
|
||||
|
||||
var myserver = try server.HttpServer.init(ip_map, ctx.config.port, &get_endpoints, &post_endpoints, &put_endpoints);
|
||||
std.debug.print("Init server: OK\n", .{});
|
||||
|
||||
std.Thread.sleep(1_000_000 * 1000 * 4);
|
||||
try myserver.start();
|
||||
std.debug.print("Server Started: OK\n", .{});
|
||||
}
|
||||
|
||||
test {
|
||||
|
|
|
@ -43,7 +43,7 @@ pub const HttpServer = struct {
|
|||
|
||||
return HttpServer{
|
||||
.address = address,
|
||||
.address_options = net.Address.ListenOptions{ .kernel_backlog = 256 },
|
||||
.address_options = net.Address.ListenOptions{},
|
||||
.get_endpoints = get_endpoints,
|
||||
.post_endpoints = post_endpoints,
|
||||
.put_endpoints = put_endpoints,
|
||||
|
|
Loading…
Reference in a new issue