Re: How to run a task continuously in the background

From: Brent Wood <pcreso(at)yahoo(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Dirk Mika <Dirk(dot)Mika(at)mikatiming(dot)de>
Subject: Re: How to run a task continuously in the background
Date: 2019-07-12 05:22:11
Message-ID: 1296430554.760012.1562908931896@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You could perhaps tweak the code for pg_cron or pg_agent for a custom solution that supports a finer time resolution?

On Friday, July 12, 2019, 5:06:42 PM GMT+12, Dirk Mika <Dirk(dot)Mika(at)mikatiming(dot)de> wrote:


 

A cron job will only run once a minute, not wake up every second. 

 

Right, that’s an issue.

 

But you could write a PHP program that does a one-second sleep before checking if there's something to do, and a batch job that runs periodically to see if the PHP program is running, and if not, launch it. 
 

I would like to avoid external programs if possible. In the current Oracle environment, there are potentially multiple schemas on a server in which processing can be active. And processing can be started, monitored and stopped from a client application. And only for the schema with which the application is connected.

 

BR

Dirk

| --
Dirk Mika
Software Developer

|
|

mika:timing GmbH
Strundepark - Kürtener Str. 11b
51465 Bergisch Gladbach
Germany

|
|
fon +49 2202 2401-1197
dirk(dot)mika(at)mikatiming(dot)de
www.mikatiming.de

|
| AG Köln HRB 47509 * WEEE-Reg.-Nr. DE 90029884
Geschäftsführer: Harald Mika, Jörg Mika |

| |

|

 

Attachment Content-Type Size
image/png 1.7 KB
CCh2U_f27a5ce6-8556-4db1-8aa4-fd610d6e9efe.jpg image/jpeg 107.2 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2019-07-12 05:57:21 Re: Download link for postgres 10.8 edb software
Previous Message Dirk Mika 2019-07-12 05:06:14 Re: How to run a task continuously in the background