Re: How to run a task continuously in the background

Поиск
Список
Период
Сортировка
От Luca Ferrari
Тема Re: How to run a task continuously in the background
Дата
Msg-id CAKoxK+7x4wEA-AMocZ00b8pAcBe2xZMq_6s8xsKPTWq7tGPdig@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to run a task continuously in the background  (Dirk Mika <Dirk.Mika@mikatiming.de>)
Ответы Re: How to run a task continuously in the background  (Dirk Mika <Dirk.Mika@mikatiming.de>)
Список pgsql-general
On Fri, Jul 12, 2019 at 7:06 AM Dirk Mika <Dirk.Mika@mikatiming.de> wrote:
>
>
>
> A cron job will only run once a minute, not wake up every second.
>
>
>
> I would like to avoid external programs if possible. In the current Oracle environment, there are potentially
multipleschemas on a server in which processing can be active. And processing can be started, monitored and stopped
froma client application. And only for the schema with which the application is connected. 
>

Creating a background worker that invokes a stored procedure once per
second? <https://www.postgresql.org/docs/11/bgworker.html>
But this is not so simple to put in place.

Otherwise pg_cron with a function that performs a pg_sleep of one
second in a loop.

Anyway, it seems to me you are better refactoring your solution: it
seems you need to process data when _new data_ comes, not once per
second, so it sounds to me like a trigger could solve the problem.

Luca



В списке pgsql-general по дате отправления:

Предыдущее
От: Dirk Mika
Дата:
Сообщение: Re: How to run a task continuously in the background
Следующее
От: jeanclaude marzin
Дата:
Сообщение: CRecordset::Open postgresql procedure call don't work