Get the worker and the registry playing nice together.
This commit is contained in:
parent
63ffa52245
commit
2fcd8df42b
3 changed files with 30 additions and 5 deletions
|
@ -5,14 +5,12 @@ import time
|
|||
|
||||
from apscheduler.scheduler import Scheduler
|
||||
|
||||
from data.queue import WorkQueue
|
||||
from data.queue import image_diff_queue
|
||||
from endpoints.registry import process_image_changes
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
image_diff_queue = WorkQueue('imagediff')
|
||||
|
||||
|
||||
def process_work_items():
|
||||
logger.debug('Getting work item from queue.')
|
||||
|
@ -23,8 +21,11 @@ def process_work_items():
|
|||
logger.debug('Queue gave us some work: %s' % item.body)
|
||||
|
||||
request = json.loads(item.body)
|
||||
process_image_changes(request['namepspace'], request['repository'],
|
||||
process_image_changes(request['namespace'], request['repository'],
|
||||
request['image_id'])
|
||||
|
||||
image_diff_queue.complete(item)
|
||||
|
||||
else:
|
||||
logger.debug('No work today.')
|
||||
|
||||
|
|
Reference in a new issue