Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Configuration for supervisor will rewrited both after supervisor and …

…relative worker editing
  • Loading branch information...
commit be53c7c020be066bf5bdd64108b0e10ff6092c1b 1 parent 030d201
@kachayev authored
Showing with 14 additions and 3 deletions.
  1. +5 −3 gearoscope/apps/scoper/models.py
  2. +9 −0 gearoscope/data/sonar.conf
View
8 gearoscope/apps/scoper/models.py
@@ -276,8 +276,9 @@ def rewrite_gearman_configuration(sender, **kwargs):
gearman = kwargs['instance']
server = gearman.server.name
- Rewriter().rebuild('gearman:%s' % server, {'server': server, 'port': port}).save()
+ Rewriter().rebuild('gearman:%s' % server, {'server': server, 'port': gearman.port}).save()
+@receiver(post_save, sender=Worker)
@receiver(post_save, sender=Supervisor)
def rewrite_supervisor_configuration(sender, **kwargs):
'''
@@ -290,12 +291,13 @@ def rewrite_supervisor_configuration(sender, **kwargs):
about necessary workers/subworkers, we should also save list of
process names (and groups in future)
'''
- supervisor = kwargs['instance']
+ supervisor = kwargs['instance'] if sender == Supervisor else kwargs['instance'].supervisor
server = supervisor.server.name
# To build map of all necessary worker name,
# we should iterate per each worker and join names
names = ','.join([worker.name for worker in Worker.objects.filter(supervisor=supervisor)])
- Rewriter().rebuild('supervisor:%s' % server, {'server': server, 'port': port, 'names': names}).save()
+ Rewriter().rebuild('supervisor:%s' % server,
+ {'server': server, 'port': supervisor.port, 'names': names}).save()
View
9 gearoscope/data/sonar.conf
@@ -18,3 +18,12 @@ host = localhost
password =
user = root
+[gearman:localhost]
+port = 4730
+server = localhost
+
+[supervisor:localhost]
+names = multiple
+port = 8999
+server = localhost
+
Please sign in to comment.
Something went wrong with that request. Please try again.