Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/client-telegram/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"os/signal"
"strings"
"syscall"
"sync"

"github.com/go-telegram/bot"
Expand Down Expand Up @@ -39,7 +40,7 @@ func main() {
}

l := New(aiSrv, usernameLimits)
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer cancel()

opts := []bot.Option{
Expand Down
3 changes: 2 additions & 1 deletion cmd/server-bot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os/signal"
"strconv"
"strings"
"syscall"

"hairy-botter/internal/ai/agent"
"hairy-botter/internal/ai/gemini"
Expand Down Expand Up @@ -165,7 +166,7 @@ func main() {
})

stopCh := make(chan os.Signal, 1)
signal.Notify(stopCh, os.Interrupt, os.Kill)
signal.Notify(stopCh, os.Interrupt, syscall.SIGTERM)
finishedCh := make(chan struct{}) // Signal the end of the graceful shutdown
go func() {
<-stopCh
Expand Down
2 changes: 1 addition & 1 deletion internal/rag/rag.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (l *Logic) loadContent() error {
return err
})

l.embeddedDocs = id - 1 // Set the number of embedded documents
l.embeddedDocs = coll.Count() // Set the number of embedded documents

l.logger.Info("rag embedding done", slog.Int("num", l.embeddedDocs))

Expand Down
Loading