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

Could not retrieve memory stats #247

Open
pipeosorio1 opened this issue May 10, 2023 · 4 comments
Open

Could not retrieve memory stats #247

pipeosorio1 opened this issue May 10, 2023 · 4 comments

Comments

@pipeosorio1
Copy link

when using the nestjs/bull library it is not possible to monitor the jobs

Captura de Pantalla 2023-05-10 a la(s) 12 03 51 p m
@OlexanderKulyk
Copy link

same error :-(

@ejhayes
Copy link
Owner

ejhayes commented Jun 15, 2023

Related to #158. This project currently only supports bullmq so anything using a bull queue either won't work or will have strange behavior.

@pipeosorio1
Copy link
Author

According to what I have reviewed, the problem is that the bull does not have the "meta" tag in redis, if it is created manually in redis, it is capable of displaying the graphics on the monitor.

image

With this Provider the registration in the job

import { Queue } from 'bull';

export class QueueProvider {
  constructor(protected readonly queue: Queue) {
    this.initializeMetaHash();
  }

  protected async initializeMetaHash(): Promise<void> {
    const prefix = process.env.APP_NAME;
    const metaKey = `${prefix}:${this.queue.name}:meta`;
    const exists = await this.queue.client.exists(metaKey);

    // Si el hash "meta" no existe se crea
    if (!exists) {
      const metaValue = { 'opts.maxLenEvents': 10000 };
      await this.queue.client.hmset(metaKey, metaValue);
    }
  }
}

@ejhayes
Copy link
Owner

ejhayes commented Jun 16, 2023

Yep, meta key was introduced by bullmq. As mentioned earlier implementing #158 is the best path forward

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

3 participants