Git Product home page Git Product logo

Comments (7)

patrik-csak avatar patrik-csak commented on June 5, 2024 2

ah, it cleans jobs before <period>, not after. thanks, @darky !

from bull-repl.

SaucyJack avatar SaucyJack commented on June 5, 2024 1

For anyone who hits on this question in the future, if you want to include state and period, do not use the "ms()" call in the period examples. So, to clean everything in the last 24 hours from the "failed" state:

clean -s failed 24h

from bull-repl.

darky avatar darky commented on June 5, 2024
BULL-REPL | bull.qwe> clean -s failed

  Missing required argument. Showing Help:       // 1*

  Usage: clean [options] <period>      // 2*

  Clean queue for period ago, period format - https://github.com/zeit/ms#examples     // 3*

  Options:

    --help                 output usage information
    -s, --status <status>  Status of the job to clean, default: completed
    -l, --limit <limit>    Maximum amount of jobs to clean per call, default: all

On line 1* you can see, that cli tool properly say you about missing required argument
On line 2* you can see, that <period> is require argument
On line 3* you can see some examples (need click to link) of <period> format

from bull-repl.

patrik-csak avatar patrik-csak commented on June 5, 2024

trying bull-repl for the first time today and clean is not working for me :

CleanShot 2023-01-06 at 11 29 59@2x

(text of screenshot for accessibility and seo)

BULL-REPL | bull.update-playlist> stats
┌───────────┬────────┐
│  (index)  │ Values │
├───────────┼────────┤
│  waiting  │   0    │
│  active   │   2    │
│ completed │   0    │
│  failed   │   4    │
│  delayed  │   0    │
│  paused   │   0    │
└───────────┴────────┘
BULL-REPL | bull.update-playlist> clean -l 10 -s failed -y 24h
Assuming yes for Clean
Jobs cleaned
BULL-REPL | bull.update-playlist> stats
┌───────────┬────────┐
│  (index)  │ Values │
├───────────┼────────┤
│  waiting  │   0    │
│  active   │   2    │
│ completed │   0    │
│  failed   │   4    │
│  delayed  │   0    │
│  paused   │   0    │
└───────────┴────────┘

from bull-repl.

darky avatar darky commented on June 5, 2024

@ptrkcsk maybe your failed jobs fail less than 24h ago?

from bull-repl.

patrik-csak avatar patrik-csak commented on June 5, 2024

it's not working for recently created jobs, but maybe it's because there's no finishedOn date?

❯ date -u  
Fri Jan  6 19:41:57 UTC 2023

❯ bull-repl
BULL-REPL> connect-to update-playlist
Connected to localhost:6379, prefix: bull, queue: update-playlist
BULL-REPL | bull.update-playlist> stats
┌───────────┬────────┐
│  (index)  │ Values │
├───────────┼────────┤
│  waiting  │   0    │
│  active   │   1    │
│ completed │   0    │
│  failed   │   0    │
│  delayed  │   0    │
│  paused   │   0    │
└───────────┴────────┘
BULL-REPL | bull.update-playlist> active
[
  {
    id: '1',
    data: { id: 1 },
    timestamp: 2023-01-06T19:39:57.086Z,
    processedOn: 2023-01-06T19:39:57.087Z,
    finishedOn: undefined,
    name: '__default__',
    failedReason: undefined,
    stackTrace: [],
    returnValue: null,
    attemptsMade: 0,
    delay: 0,
    progress: 0
  }
]
count: 1
BULL-REPL | bull.update-playlist> clean -s active -y 1d
Assuming yes for Clean
Jobs cleaned
BULL-REPL | bull.update-playlist> stats
┌───────────┬────────┐
│  (index)  │ Values │
├───────────┼────────┤
│  waiting  │   0    │
│  active   │   1    │
│ completed │   0    │
│  failed   │   0    │
│  delayed  │   0    │
│  paused   │   0    │
└───────────┴────────┘
BULL-REPL | bull.update-playlist>

from bull-repl.

darky avatar darky commented on June 5, 2024

You try to clean jobs, which created 24 hours ago
Try to pass 1m for cleaning jobs, which created 1 minute ago

from bull-repl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.