Code Monkey home page Code Monkey logo

Comments (21)

pavan612 avatar pavan612 commented on July 30, 2024 1

agenda._db = agenda._collection; //add this line before passing agenda to agenda-ui
app.use('/agenda/admin/jobs', agendaUI(agenda, {poll: 30000}));

from agenda-ui.

jeonghwan-kim avatar jeonghwan-kim commented on July 30, 2024 1
var express = require('express');
var http = require('http');
var Agenda = require('agenda');
var agendaUI = require('agenda-ui');

var app = express();
var agenda = new Agenda({
  db: {
    address: 'localhost:27017/agenda-sample'
  }
}, function (err) {
  if (err) throw err;

  console.log('Connected to database');

  // Should add this code before setting middleware.
  agenda._db = agenda._collection;

  app.use('/agenda-ui', agendaUI(agenda, {poll: 1000}));

  http.createServer(app).listen(9000, function () {
    console.log('Express listeing on 9000 port');
  });

});

Check #17

from agenda-ui.

wesley-harding avatar wesley-harding commented on July 30, 2024

My guess is this is related to a (poor) choice to change the DB driver in agenda. Seems like it might be a bit painful to fix.

agenda/agenda#213

from agenda-ui.

FLYBYME avatar FLYBYME commented on July 30, 2024

Do you have advice on what version of agenda should be used?

from agenda-ui.

wesley-harding avatar wesley-harding commented on July 30, 2024

You should be good with 0.6.8. You'll also need to use an older version of
Mongo or mongoose (I can't remember which one off the top of my head)
On Nov 10, 2015 11:40 AM, "Tim" [email protected] wrote:

Do you have advice on what version of agenda should be used?


Reply to this email directly or view it on GitHub
#18 (comment).

from agenda-ui.

b0bu avatar b0bu commented on July 30, 2024

Also having this issue

from agenda-ui.

jdnichollsc avatar jdnichollsc commented on July 30, 2024

+1

from agenda-ui.

jdnichollsc avatar jdnichollsc commented on July 30, 2024

See more info please:

http://screencast.com/t/TgcnNQvu8D
http://screencast.com/t/LhV6JnZnm
http://screencast.com/t/33zQSdxgD2

from agenda-ui.

harelba avatar harelba commented on July 30, 2024

I have the same issue, and downgrading agenda to the older version doesn't work as well.

from agenda-ui.

harelba avatar harelba commented on July 30, 2024

@pavan612 thanks for trying to help. Tried it, but I'm still getting the error -

TypeError: Cannot read property 'count' of undefined
    at Store.count (/Users/harel/dev/trickly/src/trickly/node_modules/agenda-ui/lib/store.js:41:37)
    at Store.definitions (/Users/harel/dev/trickly/src/trickly/node_modules/agenda-ui/lib/store.js:69:26)

Agenda version 0.73
Agenda-ui version 0.0.7

from agenda-ui.

pavan612 avatar pavan612 commented on July 30, 2024

@harelba this is my working code
changes.txt

from agenda-ui.

brebaje avatar brebaje commented on July 30, 2024

Thanks @pavan612 that hack worked :)

from agenda-ui.

geototti21 avatar geototti21 commented on July 30, 2024

I get the same error with @FLYBYME , I tried the solution suggested from @pavan612 but it didnt work. I'm using the latest versions from both agenda and agenda-ui. Any help? Does anyone make it work with the latest versions?
Thanks

from agenda-ui.

pavan612 avatar pavan612 commented on July 30, 2024

Hi can you post sample code of your problem

from agenda-ui.

geototti21 avatar geototti21 commented on July 30, 2024

@pavan612 my code:

var agenda = new Agenda({db: {address: configDB.url, collection: "agendaJobs"}});

agenda.name(os.hostname() + '-' + process.pid); 

agenda.on('ready', function() {
  agenda.every('30 seconds', 'Say the time', {time: new Date()});
  agenda._db = agenda._collection;
  agenda.start();
});

//some session stuff there

app.use('/agenda-ui', agendaUI(agenda, {poll: 1000}));

//...

When I go to the the node terminal I have the same error with @FLYBYME and on the browser console the following:

error

from agenda-ui.

flashsnake-so avatar flashsnake-so commented on July 30, 2024

Thanks @pavan612 that hack worked 2 :)

from agenda-ui.

xfoxfu avatar xfoxfu commented on July 30, 2024

same as @geototti21 .
I doubt that the problem may relate to that the Agenda-UI is initializied before agenda connected to the database. I would like to know if it is possible to let Agenda-UI connect to the database on its own.

from agenda-ui.

LeandroFavero avatar LeandroFavero commented on July 30, 2024

For me the hacks doesn't works :-(

from agenda-ui.

weareu avatar weareu commented on July 30, 2024

So to get the hack to work and only init ui after agenda has connected to mongo I did this:

var agenda = new Agenda({db: { address: config.agendaDb } }, function() {
    // Should add this code before setting middleware.
    agenda._db = agenda._collection;
    app.use('/agenda-ui/', agendaUI(agenda, {poll: 1000}));
});

from agenda-ui.

vsmori avatar vsmori commented on July 30, 2024

Tried all solutions, none worked 👎

from agenda-ui.

lusa avatar lusa commented on July 30, 2024

I got Agendash working very quickly with no issues so far. https://github.com/joeframbach/agendash

from agenda-ui.

Related Issues (19)

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.