You've already forked agentic-coding-workflow
feat(jobs/runners): attachment cleanup + chat DeleteAttachments query/method
This commit is contained in:
@@ -58,6 +58,7 @@ type Repository interface {
|
||||
ListExpiredOrphans(ctx context.Context, olderThan time.Duration) ([]AttachmentRef, error)
|
||||
ListAttachmentsForSoftDeletedConversations(ctx context.Context, olderThan time.Duration) ([]AttachmentRef, error)
|
||||
DeleteAttachment(ctx context.Context, id uuid.UUID) error
|
||||
DeleteAttachments(ctx context.Context, ids []uuid.UUID) error
|
||||
|
||||
// ===== PromptTemplate =====
|
||||
InsertPromptTemplate(ctx context.Context, p InsertTemplateParams) (*PromptTemplate, error)
|
||||
@@ -778,6 +779,20 @@ func (r *pgRepo) DeleteAttachment(ctx context.Context, id uuid.UUID) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *pgRepo) DeleteAttachments(ctx context.Context, ids []uuid.UUID) error {
|
||||
if len(ids) == 0 {
|
||||
return nil
|
||||
}
|
||||
pgIDs := make([]pgtype.UUID, len(ids))
|
||||
for i, id := range ids {
|
||||
pgIDs[i] = toPgUUID(id)
|
||||
}
|
||||
if err := r.q.DeleteAttachmentsByIDs(ctx, pgIDs); err != nil {
|
||||
return errs.Wrap(err, errs.CodeInternal, "delete attachments")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ===== PromptTemplate =====
|
||||
|
||||
func (r *pgRepo) InsertPromptTemplate(ctx context.Context, p InsertTemplateParams) (*PromptTemplate, error) {
|
||||
|
||||
Reference in New Issue
Block a user