aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.go b/main.go
index 9b76d0cc..99557d2b 100644
--- a/main.go
+++ b/main.go
@@ -9,6 +9,7 @@ import (
"runtime"
"sort"
"strings"
+ "time"
"git.sr.ht/~sircmpwn/getopt"
"github.com/gdamore/tcell/v2"
@@ -251,6 +252,14 @@ func main() {
aerc.PushError(msg)
}
}()
+ defer func(start time.Time) {
+ err := hooks.RunHook(
+ &hooks.AercShutdown{Lifetime: time.Since(start)},
+ )
+ if err != nil {
+ log.Errorf("aerc-shutdown hook: %s", err)
+ }
+ }(time.Now())
for event := range libui.MsgChannel {
switch event := event.(type) {
case tcell.Event: