cache is updated only at start or at individual entry level (#103)
cache is updated only at start or at individual entry level (#103)

* cache issue - deployment found in more than one director

getDeployments call internally reloads the cache.
In case of getDeployments call, deployments are fetched from
both bosh & bosh-sf. Now if there are some migrations happening
during this time, a deployment will move over to bosh-sf from bosh
and since the calls to get deployment are asynch, response from
bosh-sf could come before bosh and it could lead to a state where
cache might think that the same deployment exists in both directors.

Fix for this issue is, before firing getDeployments for a particular
director clear the cache contents for that director. This eliminates
the dupe issue all together.

* Fix JSFormat errors

* changed log level from debug to info

* cache is updated only at start or at individual entry level

every getDeployments call was updating the cache. This leads to a
timing issue, wherein while cache is getting updated, an individual
entry as well might get updated from cache. This leads to the issue
of deployment found in more than one director. So to fix this issue:
1. Cache is updated only at start. OR
2. If a deployment is not found in cache only that particular entry
gets updated.

Also added an additional check in the updateCacheMethod to not flag
it as an error if an update for same deployment in the same bosh
comes up. [i.e. for some reason cache was not delete before update,
& such scenarios need not result in error]

* Fix merge issue

sauravmndl/service-fabrik-broker,sauravmndl/service-fabrik-broker,sauravmndl/service-fabrik-broker,sauravmndl/service-fabrik-broker