question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow multiple instances of keystone

See original GitHub issue

Continuation of #1775. Let’s track our progress here, @snowkeeper @JedWatson

So for the time being all that needs to happen is for instance in List, instead of var keystone=require('../'); we want to make it like this (as you already suggested @jed):

  module.exports = function(keystone){
      //do something with    keystone
  } 

My suggestion for now is that we ​_do_​ leave the circular dependencies. We rewrite all the keystone dependents to use a closure as above.

I think these are the files that need to be updated and obviously also wherever they are required, not including tests:

  • admin/server/api/cloudinary.js
  • admin/server/api/counts.js
  • admin/server/api/download.js ???
  • admin/server/api/item/delete.js
  • admin/server/api/item/get.js
  • admin/server/api/list/delete.js
  • admin/server/api/list/download.js
  • admin/server/api/s3.js
  • admin/server/api/session/signin.js
  • admin/server/api/session/signout.js
  • admin/server/routes/home.js
  • admin/server/routes/item.js
  • admin/server/routes/list.js
  • admin/server/routes/signout.js
  • fields/types/cloudinaryimage/CloudinaryImageType.js
  • fields/types/cloudinaryimages/CloudinaryImagesType.js
  • fields/types/location/LocationType.js
  • lib/content/index.js
  • lib/content/page.js
  • lib/email.js
  • lib/list.js
  • lib/list/register.js
  • lib/list/relationship.js
  • lib/schemaPlugins/history.js
  • lib/schemaPlugins/methods/getRelated.js
  • lib/schemaPlugins/track.js
  • lib/session.js
  • lib/updateHandler.js
  • lib/updates.js
  • lib/view.js

All changes should be pushed to the prototype branch. Also, don’t forget to rebase on top of master!

IMPORTANT: wherever a file only uses a dependency of keystone, please inject the dependency directly, if possible. E.g. admin/server/api/counts.js only uses keystone.lists, i.e. I’ll be injecting lists instead of keystone.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
JedWatsoncommented, Jul 13, 2016

Unfortunately this got really out of date… I’ve picked it up in much smaller pieces and am working through the remaining bits. Will tag this issue in my commits, but basically going to do this bit by bit (and ensure everything works with individual commits going forward in master) rather than try and branch then merge a big PR.

0reactions
gautamsicommented, Apr 14, 2019

Keystone 4 is going in maintenance mode. Expect no major change. see #4913 for details. Keystone v5 is modular and flexible, see if it helps, if not open issue there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Anyone running multiple KeystoneJS instances on the same ...
Has anyone out there successfully set up a server to run multiple instances of KeystoneJS on the same OS? This should be possible...
Read more >
Multiple instances of graphql #7816 - keystonejs/keystone
1",. Try and run yarn. You will see...
Read more >
Multi-Realm Keystone - OpenStack Wiki
Currently, in order to make use of a given OpenStack service—when Keystone is in use—, a token issued by Keystone must be presented...
Read more >
Evaluation of OpenStack Multi-Region Keystone Deployments
Thus Keystone's backend of every OpenStack instance is replicated between all nodes, which allows reads and writes on any instances.
Read more >
Chapter 2. Identity Management Integration
These steps allow IdM users to authenticate to OpenStack and access resources. OpenStack service accounts (such as keystone and glance), and authorization ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found