public Task CheckForChanges(RequestHandlerContext context)
        {
            var topologyEtag = GetLongFromHeaders(Constants.Headers.TopologyEtag);

            if (topologyEtag.HasValue && Database.HasTopologyChanged(topologyEtag.Value))
            {
                context.HttpContext.Response.Headers[Constants.Headers.RefreshTopology] = "true";
            }

            var clientConfigurationEtag = GetLongFromHeaders(Constants.Headers.ClientConfigurationEtag);

            if (clientConfigurationEtag.HasValue && Database.HasClientConfigurationChanged(clientConfigurationEtag.Value))
            {
                context.HttpContext.Response.Headers[Constants.Headers.RefreshClientConfiguration] = "true";
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 2
0
        public override void Init(RequestHandlerContext context)
        {
            base.Init(context);

            Database    = context.Database;
            ContextPool = Database.DocumentsStorage.ContextPool;
            Logger      = LoggingSource.Instance.GetLogger(Database.Name, GetType().FullName);

            var topologyEtag = GetLongFromHeaders(Constants.Headers.TopologyEtag);

            if (topologyEtag.HasValue && Database.HasTopologyChanged(topologyEtag.Value))
            {
                context.HttpContext.Response.Headers[Constants.Headers.RefreshTopology] = "true";
            }

            var clientConfigurationEtag = GetLongFromHeaders(Constants.Headers.ClientConfigurationEtag);

            if (clientConfigurationEtag.HasValue && Database.HasClientConfigurationChanged(clientConfigurationEtag.Value))
            {
                context.HttpContext.Response.Headers[Constants.Headers.RefreshClientConfiguration] = "true";
            }
        }