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

repeat did nont remove whe set removeOnComplete:true #614

Closed
bulolo opened this issue Jun 25, 2021 · 1 comment
Closed

repeat did nont remove whe set removeOnComplete:true #614

bulolo opened this issue Jun 25, 2021 · 1 comment

Comments

@bulolo
Copy link

bulolo commented Jun 25, 2021

i created a removeOnComplete:true repeat job, i want to repeat one time,so i set limit to 1

{
    "code": 0,
    "data": {
        "name": "myJobName",
        "data": {
            "color": "yellow"
        },
        "opts": {
            "attempts": 0,
            "delay": 187294,
            "removeOnComplete": true,
            "repeat": {
                "cron": "0 55 16 25 6 ?",
                "limit": 1,
                "jobId": "6f3a28f0-76b5-4b84-b88d-c08bdda84b4a",
                "count": 1
            },
            "jobId": "repeat:4f6af4df3182b9dfb940f484a63f28cc:1624611300000",
            "timestamp": 1624611112706,
            "prevMillis": 1624611300000
        },
        "id": "repeat:4f6af4df3182b9dfb940f484a63f28cc:1624611300000",
        "progress": 0,
        "returnvalue": null,
        "stacktrace": null,
        "attemptsMade": 0,
        "timestamp": 1624611112706
    },
    "msg": "请求成功"
}

when the job runed ,i found the job is still in getRepeatableJobs

        {
            "key": "myJobName:6f3a28f0-76b5-4b84-b88d-c08bdda84b4a:::0 55 16 25 6 ?",
            "name": "myJobName",
            "id": "6f3a28f0-76b5-4b84-b88d-c08bdda84b4a",
            "endDate": null,
            "tz": null,
            "cron": "0 55 16 25 6 ?",
            "next": 1624611300000
        }

how to remove this repeat job when the job is Completed

@manast
Copy link
Contributor

manast commented Jul 16, 2021

removeOnComplete only removes the actual jobs, when you call to getRepeatableJobs you get the "meta" job that allows the job repetitions. If you want to delete this "meta" job you must use "removeRepeatable" or "removeRepeatableByKey".

@manast manast closed this as completed Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants