cupsffi icon indicating copy to clipboard operation
cupsffi copied to clipboard

Expected behavior or a bug?

Open konung opened this issue 9 years ago • 0 comments

Hi.

I'm playing around with cupsffi. In my setup CUPS server is remote and i'm printing from a client server that runs my Rails app.

cupsffi - automatically picked up connection from /etc/cups/client.conf and a list of all printers

I setup my printer in config ( using configatron ) like so:

configatron.printers.it = CupsPrinter.new('1-ITD-PRINT1')

Here is the issue. After I start my rails console and do some test printing it works fine. But if I do something else and then come back to printing in a few minutes it seems that is timed out and I can't get it to do anything: print, list printers, or jobs

The only way to restart connection is either restart the app, or recreate connection specifying the server

configatron.printers.it = CupsPrinter.new('1-ITD-PRINT1', {hostname: 192.168.1.38})

Now I can print again. Until I leave printing for a few minutes and then the connection is timed out again.

When it becomes an issue: well in development - for sure - but I can just recreated the connection. But it may be an issue in some of the rake tasks - I have some long runing tasks - reports, updates, and some of them do a fair amount of printing, with some idle periods between the jobs. Right now I'm sending system commands, but I'd like to avoid that - so I'm tryuing out cupffi

So is this supposed to happen? If so where is the time out set and is it possible to control it? If the connection is lost, do I need to destroy the printer object / close connection? I don't want to pollute memory with a bunch of unwanted and unused printer objects.

Thank you!

konung avatar May 22 '15 13:05 konung