Running a method periodically on a Seaside site

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Running a method periodically on a Seaside site

sergio_101
I would like to run an “update all data” type method that grabs data from a few services, crunches it, and spits data to another service. I would like to run this twice a day.

What is the most Smalltalk/Pharo/Seaside approach to such a thing?

I thought about running it from the command line using a cron job, which I would totally like, but the job dies because it tries to run another copy of the same image with Seaside already running.

I thought about creating a REST endpoint, and calling it via wget using cron, but I got too bogged down in installing the Seaside REST packages, and running into errors everywhere.

Any suggestions?

Thanks!

----
peace,
sergio
photographer, journalist, visionary


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Running a method periodically on a Seaside site

Sven Van Caekenberghe-2
Just use a process like this (in your run.st file):

[ [
    1 minute wait.
    Bla sendOlderOutstanding.
] repeat ]
    forkAt: Processor lowIOPriority
    named: 'Periodic Sigfox sendOlderOutstanding'.

[ [
    5 minutes wait.
    Bla transferT3SigfoxDownlinks.
] repeat ]
    forkAt: Processor lowIOPriority
    named: 'Periodic Sigfox transferT3SigfoxDownlinks'.

You could also add an error handler to protect your process from dying when an error occurs in one iteration.

> On 18 Mar 2019, at 16:28, sergio ruiz <[hidden email]> wrote:
>
> I would like to run an “update all data” type method that grabs data from a few services, crunches it, and spits data to another service. I would like to run this twice a day.
>
> What is the most Smalltalk/Pharo/Seaside approach to such a thing?
>
> I thought about running it from the command line using a cron job, which I would totally like, but the job dies because it tries to run another copy of the same image with Seaside already running.
>
> I thought about creating a REST endpoint, and calling it via wget using cron, but I got too bogged down in installing the Seaside REST packages, and running into errors everywhere.
>
> Any suggestions?
>
> Thanks!
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Running a method periodically on a Seaside site

Esteban A. Maringolo
In reply to this post by sergio_101
I did this to collect some data and report it daily (by mail, etc.)
and also every 5' to feed other services.

What I did was to use a cron task that ran Pharo that called a simple
script such as follows:

```
NonInteractiveTranscript stdout install.
ProviderDailyNotificator runForTheLastWeek.
Smalltalk quitPrimitive.
```

The output was sent to a log file as well.

All the logic of whether to retry notifications etc. was handled by
the `ProviderDailyNotificator` class.

Regards,

Esteban A. Maringolo

El lun., 18 mar. 2019 a las 12:28, sergio ruiz
(<[hidden email]>) escribió:

>
> I would like to run an “update all data” type method that grabs data from a few services, crunches it, and spits data to another service. I would like to run this twice a day.
>
> What is the most Smalltalk/Pharo/Seaside approach to such a thing?
>
> I thought about running it from the command line using a cron job, which I would totally like, but the job dies because it tries to run another copy of the same image with Seaside already running.
>
> I thought about creating a REST endpoint, and calling it via wget using cron, but I got too bogged down in installing the Seaside REST packages, and running into errors everywhere.
>
> Any suggestions?
>
> Thanks!
>
> ----
> peace,
> sergio
> photographer, journalist, visionary
>
> Public Key: http://bit.ly/29z9fG0
> #BitMessage BM-NBaswViL21xqgg9STRJjaJaUoyiNe2dV
> http://www.codeandmusic.com
> http://www.twitter.com/sergio_101
> http://www.facebook.com/sergio101
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside