select * from table where d.location = 'POINT(0 0)'::geometry and d.datum < (timestamp 'now' - interval '1 year') alter table [table] OWNER to [owner] Grootte van een jsonb rij: select pg_column_size(datab) from table; select json_strip_nulls(row_to_json(t))::jsonb - 'columnname_to_skip' from table t where t.id = 'id';
donderdag 18 april 2024
Postgresql Tips
maandag 15 april 2024
Always try/catch in a Task.Run in websockets
When you run the following code:
System.Threading.Tasks.Task.Run(() => { throw new Exception(); });
Console.ReadKey();
You will see that the exception is not shown on screen. That's because the task stops within it's own context.
That behaviour is very problematic if the task contains code that sends information over a websocket. The method that contains the Task.Run will probably still be alive, however the task is stopped. The websocket methods will continue, the task will however not send or receive information anymore. In that case you have a websocket which is alive on a network level but dead on a functional level.
To prevent this situation, always use try/catch blocks within the Task.Run.
Abonneren op:
Posts (Atom)