Giter VIP home page Giter VIP logo

connect-loki's Introduction

Requarks Logo Requarks

License Build Status Codacy Badge Codacy Badge Dependency Status GitHub release Documentation Gitter

Requests and Bugs Tracking Management System

Under development

Milestones
  • Base Layout
  • Setup
  • Dashboard
    • Rotating backgrounds
    • Stats
    • Todos
    • Pinned
    • Active Projects
  • Global Search
  • Create
    • Category selection screen
    • Request
    • Attachments
  • Review
    • List view
    • Filters
    • Search
  • Item
  • Projects
    • Project
    • Sprints
    • Create Project
    • Edit Project
    • Add Teams / Members
  • Teams
    • Team
    • Create Team
    • Edit Team
    • Add Team Members
  • Settings
    • Profile
    • Avatar
    • Preferences
    • Notifications
  • Administration

connect-loki's People

Contributors

minond avatar ngpixel avatar okarimo17 avatar yurks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

connect-loki's Issues

ttl does not work

Hello,
I have played around with the ttl option and I can confirm that it does NOT work.
The problem is that when the lokijs collection is created, you do it like this:

        self.collection = self.client.addCollection('Sessions', {
          indices: ['sid'],
          ttlInterval: self.ttl
        })

... which is wrong because you are setting the check interval, but you are not specifying the age.
Also, the connect-loki ttl option is supposed to be in seconds whereas the ttlInterval is in milliseconds.
So the correct way to initialize the collection should be:

        self.collection = self.client.addCollection('Sessions', {
          indices: ['sid'],
          ttl: self.ttl*1000,            // age
          ttlInterval: 5000       // interval (equal to autosaveInterval)
        })

I have tested the above configuration and it does work as expected.
Please check it yourself and let me know how it goes.
Thanks!
Alex

TypeError: Cannot read property 'find' of undefined

Some times Below Error happening and I couldn't know what is the problem. can you please check.

TypeError: Cannot read property 'find' of undefined
at LokiStore.get (C:\node_modules\connect-loki\lib\connect-loki.js:98:29)
at session (C:\node_modules\express-session\index.js:481:11)
at Layer.handle [as handle_request] (C:\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (C:\node_modules\express\lib\router\index.js:317:13)
at C:\node_modules\express\lib\router\index.js:284:7
at Function.process_params (C:\node_modules\express\lib\router\index.js:335:12)
at next (C:\node_modules\express\lib\router\index.js:275:10)
at expressInit (C:\node_modules\express\lib\middleware\init.js:40:5)
at Layer.handle [as handle_request] (C:\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (C:\node_modules\express\lib\router\index.js:317:13)
at C:\node_modules\express\lib\router\index.js:284:7
at Function.process_params (C:\node_modules\express\lib\router\index.js:335:12)
at next (C:\node_modules\express\lib\router\index.js:275:10)
at query (C:\node_modules\express\lib\middleware\query.js:45:5)
at Layer.handle [as handle_request] (C:\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (C:\node_modules\express\lib\router\index.js:317:13)

Code Optimization. Code Refactor.

In connect-loki/lib/connect-loki.js:

  1. Promise = require('bluebird')//it is unused. It can be safely removed from code.
  2. You use only noop and isNill from loadash. But what is the reason to load hole loadash for this simple function and also add additional dependency? noop = function () {} and isNill = obj === null.
    So in package.json you can remove
"dependencies": {
    "bluebird": "^3.4.1",
    "lodash": "^4.15.0",
}
  1. What is the reason always pass to the function callpack functuion as a parameter? Like:
	LokiStore.prototype.clear = function (fn) {
		if(!fn) { fn = _.noop; }
		this.collection.clear();
		fn(null);
	};

I would make it more cleaner:

	LokiStore.prototype.clear = function () {
		return this.collection.clear();
	};

Because I guess "clear" method is synchronous and you don't need callback there.
So
lokiStore.clear(callback)
can be easily be rewritten to:

lokiStore.clear();
callback();

unable to destroy session

when i am trying to destroy a session (store.destroy ) with following code
route.js

30   var store=req.sessionStore;
31   store.destroy(sessionID, function(error){
32      logger.info("Session destroyed");
33      res.end();
30  });

i am getting this error

Error: Object is not a document stored in the collection
   at LokiEventEmitter.Collection.remove (/home/rohith/workspace/express/SelfcareServer/node_modules/lokijs/src/lokijs.js:4112:15)
   at LokiStore.client.loadDatabase.LokiStore.destroy (/home/rohith/workspace/express/SelfcareServer/node_modules/connect-loki/lib/connect-loki.js:151:19)
   at /home/rohith/workspace/express/SelfcareServer/modules/routes.js:31:13

Can somebody help me out this problem ?

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.