agenda: added retry on error
This commit is contained in:
parent
b23a7a87c3
commit
0f91ff34ab
|
@ -1,5 +1,5 @@
|
|||
import { App, Astal, Gdk } from "astal/gtk3";
|
||||
import { bind, execAsync, interval, Variable } from "astal";
|
||||
import { bind, execAsync, interval, timeout, Variable } from "astal";
|
||||
|
||||
type AgendaItem = {
|
||||
startDate: string;
|
||||
|
@ -65,6 +65,10 @@ export default function Agenda(gdkmonitor: Gdk.Monitor) {
|
|||
transform(stdout),
|
||||
]);
|
||||
};
|
||||
agenda.onError((err) => {
|
||||
console.error(`failed to fetch agenda: ${err}`);
|
||||
timeout(5000, watch);
|
||||
});
|
||||
const intervalHandler = interval(1000 * 60 * 10 /* 10 minutes */, watch);
|
||||
return (
|
||||
<window
|
||||
|
|
Loading…
Reference in a new issue