Skip to content

zone.current is undefined for cluster mode #3

@nikolay-rogovoy

Description

@nikolay-rogovoy
            // test 2 - Failed: current is undefined <---
            zone.current.fork({
                name: 'api',
                properties: {
                    id: 2
                }

Full version:
https://github.com/nikolay-rogovoy/test_js/blob/master/src/main_2.js

Steps to reproduce:

  1. git clone https://github.com/nikolay-rogovoy/test_js.git
  2. cd test_js
  3. npm i
  4. npm run main_2
  5. send http request: get http://localhost:8000/api/test
  6. test 2 - Failed

Proposed Solution:
index.js :

  before(uid) {
    if (zones[uid]) {
      current = zones[uid];
    } else {
      zones[uid] = current;
    }
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions