Add the event service

This commit is contained in:
Achim Rohn
2025-11-16 19:54:42 +01:00
parent bcc5c7493d
commit 049fefed75
26 changed files with 2656 additions and 9 deletions
+3 -2
View File
@@ -284,7 +284,7 @@ func (q *GeneralQueue) processNext(ctx context.Context, handler GeneralQueueHand
}
// Enqueue adds a new job to the queue
func (q *GeneralQueue) Enqueue(ctx context.Context, payload any, maxRetries int, userId int, groupId int) (*ent.GeneralQueue, error) {
func (q *GeneralQueue) Enqueue(ctx context.Context, payload any, maxRetries int, userId int) (*ent.GeneralQueue, error) {
now := time.Now()
payloadMap, err := StructToMap(payload)
@@ -300,7 +300,8 @@ func (q *GeneralQueue) Enqueue(ctx context.Context, payload any, maxRetries int,
SetNumberOfTries(0).
SetMaxRetries(maxRetries).
SetCreatedAt(now).
SetUpdatedAt(now)
SetUpdatedAt(now).
SetUserID(userId)
job, err := create.Save(ctx)