[kforge-dev] Timing of notification of events: problems in relation to apache config generation

Rufus Pollock rufus.pollock at okfn.org
Sun Nov 13 19:22:41 UTC 2005


I was in process of implementing auto re-generation of apache config in 
response to relevant events such as service creation and deletion. In 
doing so ran into the following problem:

Apache config building runs off domain. It creates service configuration 
sections by iterating through service items in the domain. This means:

   onServiceCreate: raised after service created in domain so will 
create apache config ok

   onServiceDelete: raised **before** service deleted in domain so will 
**not** create apache config ok (apache config will still be there for a 
non-existent service). PROBLEM.

This isn't the most serious issue as url for deleted service will simply 
give an error but it is still not great (it would be really problematic 
if it were the other way around -- i.e. service creation didn't work). 
One solution would be to have (as previously suggested) more 
fine-grained event notification such as beforeServiceDelete and 
afterServiceDelete but this will add complexity.

~rufus




More information about the kforge-dev mailing list