private static void LastDataInsert(CancellationToken token, QueueWriter writer) { token.Register(() => { writer.WriteToDbAsync(true).GetAwaiter().GetResult(); }); }