Skip to content

Commit

Permalink
Log conflicts and created items by the periodic resource sync (ansibl…
Browse files Browse the repository at this point in the history
…e#15337)

* Initial lazy logging of periodic sync results

* Add desired polish to log

* Add debug log
  • Loading branch information
AlanCoding authored Jul 9, 2024
1 parent 7fc3d5c commit b727d2c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion awx/main/tasks/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,5 +980,15 @@ def periodic_resource_sync():
if acquired is False:
logger.debug("Not running periodic_resource_sync, another task holds lock")
return
logger.debug("Running periodic resource sync")

SyncExecutor().run()
executor = SyncExecutor()
executor.run()
for key, item_list in executor.results:
if not item_list or key == 'noop':
continue
# Log creations and conflicts
if len(item_list) > 10 and settings.LOG_AGGREGATOR_LEVEL != 'DEBUG':
logger.info(f'Periodic resource sync {key}, first 10 items:\n{item_list[:10]}')
else:
logger.info(f'Periodic resource sync {key}:\n{item_list}')

0 comments on commit b727d2c

Please sign in to comment.