Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
topfunky opened this issue Jun 17, 2013 · 7 comments
Open

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

topfunky opened this issue Jun 17, 2013 · 7 comments

Comments

@topfunky
Copy link

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);
});
@zimbatm
Copy link
Contributor

zimbatm commented Jul 15, 2013

/cc @vivienschilis

@vivienschilis
Copy link
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?

@vivienschilis
Copy link
Contributor

Oh ok no I think I found the issue.

@vivienschilis
Copy link
Contributor

Actually,

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

What's your nodejs version?

@vivienschilis
Copy link
Contributor

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

@vivienschilis
Copy link
Contributor

Ok I updated npm with the latest version

@topfunky
Copy link
Author

Thanks, Vivien! I'll try it out.

On Mon, Jul 15, 2013 at 7:17 AM, Vivien Schilis [email protected]:

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
[email protected]
........................
PeepCode Screencasts
http://peepcode.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants