Skip to content

Commit

Permalink
Add periodic query
Browse files Browse the repository at this point in the history
  • Loading branch information
rdnt committed Sep 12, 2023
1 parent f1c276b commit 9a0ca8a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func New(app application.Application, remote *remote.Remote) (*Scheduler, error)
log: logger.New("scheduler", logger.DefaultColor),
}

_, err := s.sched.Every(10).Second().
_, err := s.sched.Every(1).Second().
StartAt(time.Now()).
Do(s.sync)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/AppRoute.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
}
const interval = setInterval(checkState, 20000);
const interval = setInterval(checkState, 1000);
onDestroy(() => clearInterval(interval));
Expand Down
14 changes: 11 additions & 3 deletions ui/src/pages/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@
$: ready;
onMount(async () => {
await refresh()
ready = true
})
const refresh = async () => {
await getKeystores()
const u = await getCurrentUser()
if (u) {
await getInvitations()
}
ready = true
})
}
const interval = setInterval(refresh, 5000);
onDestroy(() => clearInterval(interval));
const onKeystoreCreated = async (keystore: Keystore) => {
await getKeystores()
await refresh()
navigate(`/keystore/${keystore.id}`)
}
</script>
Expand Down

0 comments on commit 9a0ca8a

Please sign in to comment.