tâches planifiées : prompts cron persistés, outil scheduler, conversations liées aux tâches, rattrapage des exécutions manquées au redémarrage (go-cron MissedRunOnce)

This commit is contained in:
fabien committed 2026-10-06 22:15:59 +02:00
1 parent bedb6c98e7
commit 058370830f
71 files changed
+1627 -100

No files matched your search

@@ -2,6 +2,7 @@ package turso
import (
"database/sql"
"fmt"
"log"
"strings"
@@ -30,7 +31,7 @@ func NewTursoChatRepository(db *sql.DB) *TursoChatRepository {
}
}
func (r *TursoChatRepository) ListChats(userID string, teamID string, page int, query string) ([]*domain.Chat, error) {
func (r *TursoChatRepository) ListChats(userID string, teamID string, page int, query string, taskID string) ([]*domain.Chat, error) {
where := "team_id=$1 and team_id in (select team_id from user_teams where user_id=$2)"
args := []any{teamID, userID}
if query != "" {
@@ -41,6 +42,10 @@ func (r *TursoChatRepository) ListChats(userID string, teamID string, page int,
where += " and title like $3 escape '\\'"
args = append(args, "%"+escaped+"%")
}
if taskID != "" {
where += fmt.Sprintf(" and task_id=$%d", len(args)+1)
args = append(args, taskID)
}
return r.chatTable.Select(
orm.WithWhere(where, args...),
orm.WithOrder("_date_created desc"),