Open
Description
batch_cache:44 returns
:gen_event handler LogflareLogger.HttpBackend installed in Logger terminating
** (exit) an exception was raised:
** (BadFunctionError) expected a function, got: :asc
(elixir) lib/enum.ex:2354: anonymous fn/3 in Enum.sort_by/3
(stdlib) lists.erl:969: :lists.sort/2
(elixir) lib/enum.ex:2354: Enum.sort_by/3
(logflare_logger_backend) lib/logflare_logger/batch_cache.ex:44: LogflareLogger.BatchCache.flush/1
(logflare_logger_backend) lib/logflare_logger/http_backend.ex:147: LogflareLogger.HttpBackend.flush!/1
(stdlib) gen_event.erl:577: :gen_event.server_update/4
(stdlib) gen_event.erl:559: :gen_event.server_notify/4
(stdlib) gen_event.erl:347: :gen_event.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Relevant fix:
Change:
Enum.sort_by(pending_events, & &1.id, :asc)
to
Enum.sort_by(pending_events, &(&1.id), &<=/2)
Metadata
Metadata
Assignees
Labels
No labels