Skip to content
Snippets Groups Projects
Commit 584d2e64 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added 'RetrievePreprocessor' class skeleton.

parent e94c233f
Branches
No related tags found
No related merge requests found
from config import Config
from db_connector import DbConnector
from task_executor import TaskExecutor
class RetrievePreprocessor(TaskExecutor):
def __init__(self):
config = Config("vos_ts.conf")
self.params = config.loadSection("file_catalog")
self.dbConn = DbConnector(self.params["user"],
self.params["password"],
self.params["host"],
self.params.getint("port"),
self.params["db"])
super(RetrievePreprocessor, self).__init__()
def run(self):
print("Starting retrieve preprocessor...")
self.setSourceQueueName("read_pending")
self.setDestinationQueueName("read_ready")
while True:
self.wait()
if self.destQueue.len() < self.maxReadyJobs and self.srcQueue.len() > 0:
self.jobObj = self.srcQueue.getJob()
# do something here...
self.srcQueue.extractJob()
self.destQueue.insertJob(self.jobObj)
print(f"Job {self.jobObj.jobId} MOVED from {self.srcQueue.name()} to {self.destQueue.name()}")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment