> I am trying to configure fastrouter through environment variable and > running into trouble. > > 1. A blank loop still seems to run.. I expected that no subscription > would > take place when the for was empty? > > [uwsgi] > ... > fastrouter_keys= > fastrouter_ip= > fastrouter_port= > > # Subscribe this instance to a fastrouter > for=%(fastrouter_keys) > subscribe-to=%(fastrouter_ip):%(fastrouter_port):%(_) > endfor= > > and the log ... > > subscribing to :: > send_subscription()/sendto(): Invalid argument [core/subscription.c line > 665] > send_subscription()/sendto(): Invalid argument [core/subscription.c line > 665] > send_subscription()/sendto(): Invalid argument [core/subscription.c line > 665] > > > > 2. A list of values is treated single? > > export FASTROUTER_KEYS="a b c" > > [uwsgi] > fastrouter_keys=$(FASTROUTER_KEYS) > fastrouter_ip=... > fastrouter_port=... > > # Subscribe this instance to a fastrouter > for=%(fastrouter_keys) > subscribe-to=%(fastrouter_ip):%(fastrouter_port):%(_) > endfor= > > And logs on fastrouter > > [uwsgi-subscription for pid 5] new pool: a b c (hash key: 3007) > fastrouter_1 | [uwsgi-subscription for pid 5] a b c => new node: > 172.17.1.37:56481 > > I was expecting to see three separate subscribes. > > >
Hi, you cannot pass variables to for and if constructs, they are evaluated before the substitution. I would probably put the list of subscription keys in a text file and i would manage it with for-readline Take in account that passing @foo as the subscription key will force the subscription system to open the file 'foo' and read it line by line (each line is a subscription key) -- Roberto De Ioris http://unbit.com _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
