Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
I Am Wondering Is It Possible To Schedule A Task To Run At Certain Time In Periodic Fashion Aka. Cron Style... Thinking Of Having A Monitoring Task To Be Run Routinely ... I Could Use A Cron On One Of The Server But Prefer To Run It On Trains As Then I Am

I am wondering is it possible to schedule a task to run at certain time in periodic fashion aka. cron style... thinking of having a monitoring task to be run routinely ... i could use a cron on one of the server but prefer to run it on trains as then i am not relying on a single server being up

  
  
Posted 4 years ago
Votes Newest

Answers 6


ok so controller task is a simple place holder which run infinitely and fetch a task template and queue it..

  
  
Posted 4 years ago

Hi PompousParrot44 , you could have a Controller task running in the services queue that periodically schedules the task you want to run

  
  
Posted 4 years ago

any example in the repo which i can go through

  
  
Posted 4 years ago

Yes JitteryCoyote63 I think you are correct, this currently the easiest to do. PompousParrot44 notice that you should have a "services" queue with a trains-agent "services mode" running to enqueue those type pf mostly sleeping services 🙂
I was thinking we can quickly create a service that does that, maybe leverage one of these ?
https://github.com/mehrdadmhd/scheduler-py
https://github.com/dbader/schedule
WDYT?

  
  
Posted 4 years ago

I don't think there is an example for this use case in the repo currently, but the code should be fairly simple (below is a rough draft of what it could look like)
` controller_task = Task.init(...)
controller_task.execute_remotely(queue_name="services", clone=False, exit_process=True)

while True:
periodic_task = Task.clone(template_task_id)
# Change parameters of {periodic_task} if necessary
Task.enqueue(periodic_task, queue="default")
time.sleep(TRIGGER_TASK_INTERVAL_SECS) `

  
  
Posted 4 years ago

Thats how I would do it, maybe guys from allegro-ai can come up with a better approach 👍

  
  
Posted 4 years ago
871 Views
6 Answers
4 years ago
one year ago
Tags