Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] register same type task but it excute once ,when try several times it was no excute!! #974

Closed
Godhanhn opened this issue Nov 22, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Godhanhn
Copy link

Describe the bug
register same type task but excute once ,when try several times it was no excute!!

Environment (please complete the following information):

  • OS: [e.g. MacOS, Linux]
  • asynq package version [e.g. v0.24.1]
  • Redis/Valkey version

t.Run("test settle activity task payload", func(t *testing.T) {

	for i := 0; i < 10; i++ {
		RegisterSettleActivityTask(&settle.SettleActivityTaskPayload{
			ActivityId: 1,
			RankId:     1,
			SeasonId:   int32(i),
			ServerId:   1000,
		})
	}

})

func registerSettleActivityTaskImpl(payLoad *settle.SettleActivityTaskPayload) bool {
t1, err := NewSettleActivityTask(payLoad)
if err != nil {
prome.Incr(code.ServiceTaskQueue, fmt.Sprintf("task_create_failed_activity_%d_season_%d_server_%d", payLoad.ActivityId, payLoad.SeasonId, payLoad.ServerId))
logger.BaseWarnLog("could not create task:", err.Error(), payLoad)
return false
}

// 发送奖励
_, err = client.GetClient().Enqueue(t1, asynq.MaxRetry(3))
if err != nil {
	prome.Incr(code.ServiceTaskQueue, fmt.Sprintf("task_enqueue_failed_activity_%d_season_%d_server_%d", payLoad.ActivityId, payLoad.SeasonId, payLoad.ServerId))
	logger.BaseWarnLog("could not enqueue task:", err.Error(), payLoad)
	return false
}

}

@Godhanhn Godhanhn added the bug Something isn't working label Nov 22, 2024
@Godhanhn Godhanhn changed the title [BUG] register same type task but excute once ,when try several times it was no excute!! [BUG] register same type task but it excute once ,when try several times it was no excute!! Nov 22, 2024
@Godhanhn
Copy link
Author

Logger:

Task Info
ID:
99a9ebbb-cf1a-4e29-868f-3dcd286c37ae

Type:
activity_settle

State:
archived

Queue:
default

Retry:
3/3

Last Failure:
handler not found for task "activity_settle" (2024-11-25T13:33:03Z)

Next Process Time:

Timeout:
1800 seconds

Deadline:

Payload:
{
"activityId": 1,
"rankId": 1,
"gId": 0,
"seasonId": 461,
"serverId": 30001
}

@Godhanhn
Copy link
Author

it was solved! There is another server here that is also consuming, which makes me mistake for thinking that it is not executing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants