Hello,
I didn't think about this. But yes my 'store' is in the global scope.
I tried with the 'files' in the global scope too without any success.
in this way, i tried to declare the callback function separately like
this:
////////////////////////////////////////
function capture(){
store.capture(files, callbackCapture)
}
function callbackCapture(url, success, captureId){
console.log('captured: ' + url + ' ----success: ' + success +
'----captureId: ' + captureId);
}
//////////////////////////////////////
but it didn't work either.
An other thing, in my function when i capture I declare the store like
this:
function capture(){
try {
localServer = google.gears.factory.create('beta.localserver');
localServer.removeStore(STORE_NAME);
store = localServer.createStore(STORE_NAME);
}
catch (ex) {
console.log('Could not remove local server: ' + ex.message);
}
store.capture(files, callbackCapture)
}
Maybe the 'remove' and 'createStore' are not yet finished when the
capture begins...
So I tried to separate these 3 actions, using 3 buttons: one to say
"remove", an other one to say "create" and the last one to capture.
With this technique, I can't reproduce the problem ( for few tests i
did), it seems to wok well.
Any Idea?
Loic
On 6 mai, 19:13, Michael Nordman <[email protected]> wrote:
> I think if the 'store' is garbage collected prior to capture
> completion, pending captures are dropped. Is there an reference to the
> 'store' in the global scope? And if not, does adding one make a
> difference?
>
> On Wed, May 6, 2009 at 8:12 AM, frog <[email protected]> wrote:
>
> > Hi,
> > I'm having problems with the method capture() of the ressource store.
> > Sometimes, when i want to capture an url or an array of url, I can't
> > capture all ressources, either I can't access all ressource, that is
> > to say that I don't have any callback or it stops in the middle of the
> > capture of an array without other messages.
> > I can show you my code where I use the method:
>
> > //////////////////////////////////////////////////////////////////////////
> > console.log('file to capture: ' + files);
> > console.log('begin capture');
>
> > store.capture(files, function(url, success, captureId){
> > console.log('captured: ' + url + ' ----success: ' + success +
> > '----captureId: ' + captureId);
> > });
>
> > //////////////////////////////////////////////////////////////////////////
>
> > and my Firebug Panel to show you what happens:
>
> > //////////////////////////////////////////////////////////////////////////
>
> >>create local server
> >>file to capture: http://...<URL1>, http://<URL2>, http://<URL3>,
> >>http://<URL4>,...
> >>begin capture
> >>END create Local Server
> >>captured: http://<URL1> ----success: true----captureId: 1
> >>captured: http://<URL2> ----success: true----captureId: 1
>
> > //////////////////////////////////////////////////////////////////////////
>
> > So, as you can see it stop at the middle without reasons, sometimes it
> > doesn't begin, sometimes it goes until the end of my array... I don't
> > understand what is happening.
> > I can't find a solution, I tried lot of things without success.
> > has anybody a solution?
> > thanks.
>
> > Loic