Hi,
I'm currently working on a darktable piwigo plugin to give the possibility to upload picture directly from darktable.
All is working fine:
- create new album
- assign parent album to new album
- upload picture
- control the visibility
- control tags export
All this is done in CURL as expected by darktable.
I have one issue though, when I upload lot of pictures I lost the connection to the server after 1h or so.
Is there a way to prevent that? Of course I could restart the connection, but I was wondering if there was a smarter way to do it like sending a keep-alive or asking for a longer time-out?
Thanks,
Offline
How are you handling the requests to upload, one image per request, or multiple files at a time?
Does it work for say 1,5,10,etc photos?
Does it fail after a specific time or specific number of photos?
You could possibly write the script to upload a certain number of photos per run, or implement error handling of some kind, or launch cURL for every X photos so it doesn't timeout.
Lastly the timeout could be on the server side, either the script itself timing out which may be addressed or a server timeout which may or may not be addressed depending on how your site is hosted.
I look forward to hearing about how it is setup so far.
Offline
I'm using libcurl and not curl directly. Basically, this means:
1. I create the libcurl context
2. I connect to my account
3. I upload the picture one by one using pwg.images.addSimple
And I do 3 multiple times of course if I have selected 300 pictures or more.
And at some point (around 1h) the connection drops and I need to re-authenticate.
My question is, is this standard? Is the drop after 1h is something I can do about at connection time?
If not, I'll reconnect automatically every 45 minutes or so. All is possible!
Thanks.
Offline
I guess the big question is where is the timeout happening...
Does the http/tcp connection become non-responsive or close "unexpectedly", then that may be a server side timeout which might be corrected in the server settings, however an hour for a keep alive session is pretty long, I'd honestly look into breaking it down, say loop through photos for 5 minutes, reconnect, etc. Unless you can figure out doing multiple requests at a time.
I'd be very interested in trying out your darktable extension.
Offline
Ok, to avoid this issue without knowing really where the timeout happens (I do think it is on the server) I have implemented an automatic re-connection when CURL returns an error. Looks like it is working.
If you want to try the piwigo plugin you'll have to compile darktable yourself for the moment, see:
https://github.com/darktable-org/darktable/tree/piwigo
Note that this plug-in is still in development but I have already been able to publish some albums with it.
Offline