Skip to content

Creating two clients re-uses variables from the first client #2

Open

Description

@topfunky

I'm sending a video out to two different clouds using the Node.js client.

When I create a second client, I get an error that the API request wasn't properly signed. It appears that the Panda client is caching variables internally, which makes it impossible to use it twice in an app.

The script works fine if I use either the configuration data from cloudA or from cloudB.

var clientA, clientB, options, panda;

panda = require('panda');

options = {
  source_url:  'http://example.com/my-video.mov',
  payload:     'my-video',
  path_format: 'my-video/:id'
};

clientA = panda.createClient(config['cloudA']);
clientA.post('/videos.json', options, function(response) {
  return console.log(response);
});

// This throws an error about the wrong URL and args. Works fine alone.
clientB = panda.createClient(config['cloudB']);
clientB.post('/videos.json', options, function(response) {
  return console.log(response);
});

Activity

  1. zimbatm commented on Jul 15, 2013

    @zimbatm
  2. vivienschilis commented on Jul 15, 2013

    @vivienschilis
    Contributor

    Hi @topfunky, we were not 'Watching' this repo strangely.
    We fixed the issue on master I think.

    Can you have give it a try?

  3. vivienschilis commented on Jul 15, 2013

    @vivienschilis
    Contributor

    Oh ok no I think I found the issue.

  4. vivienschilis commented on Jul 15, 2013

    @vivienschilis
    Contributor

    Actually,

    I did this test:
    https://gist.github.com/vivienschilis/6000075
    I and I get two different results.

    What's your nodejs version?

  5. vivienschilis commented on Jul 15, 2013

    @vivienschilis
    Contributor

    Ok can actually, can you use git master and tell me if that works. thx

  6. vivienschilis commented on Jul 15, 2013

    @vivienschilis
    Contributor

    Ok I updated npm with the latest version

  7. topfunky commented on Jul 15, 2013

    @topfunky
    Author

    Thanks, Vivien! I'll try it out.

    On Mon, Jul 15, 2013 at 7:17 AM, Vivien Schilis notifications@hub.lumenfield.workwrote:

    Ok I updated npm with the latest version

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-20972225
    .

    Geoffrey Grosenbach
    boss@topfunky.com
    ........................
    PeepCode Screencasts
    http://peepcode.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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