consul-templaterb 1.15.0 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5683a9f5392630b3d6579fa02f0f7d29947287a9
4
- data.tar.gz: f5f80b967020d8a6ee0e8bfd4b106f369335313c
3
+ metadata.gz: 8b78e19b82cfe21d36bd7985cfb3676bf6eb4adf
4
+ data.tar.gz: 03fc0513a55921094d962be1f6ec9ae730058244
5
5
  SHA512:
6
- metadata.gz: 942b22b9f18e721dcc36bd085ea324d224492d0e8e9dd0903009d8e04f261238505400a95ca5626ef60751e4d7a78ded148c96c6ed6993f1b40da17930647571
7
- data.tar.gz: f3a80693d9302686c78285c5e85103a7085884178849d32954f1c67d85335ead7ec9e2a0cd94c2e9fe849fdc0ba8f8cf2929a51051af8ffea8ecc277eccc8553
6
+ metadata.gz: 9991598e1ca634be45e4239b5a279e37dce68413d293a64d68d7b028e103ff0a68895721e92c96adb742bdf623c2184b83fbd2852f44bffb0934fd198be562c2
7
+ data.tar.gz: c4f9c73248c2c3fcfe170f5dd2a183585400a2ac2bf6f8ee4bdf57a9b5dfcd42d5059eba20af88fbf682706aced1d3fd284da1441f1f6b6d422669665ae63549
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## (UNRELEASED)
4
4
 
5
+ ## 1.15.1 (May 14, 2019)
6
+
7
+ IMPROVEMENTS
8
+
9
+ Will converge faster if some templates are not always requesting the same paths.
10
+ Intead of relying on key being garbage collected, we now rely whether the key is
11
+ available within the current rendering only.
12
+ It avoid templates never rendering fully when keys appear/disappear.
13
+
5
14
  ## 1.15.0 (May 14, 2019)
6
15
 
7
16
  NEW FEATURES
@@ -209,16 +209,17 @@ module Consul
209
209
  end
210
210
 
211
211
  def write(file, tpl, last_result, tpl_file_path, params = {}, current_template_info: {})
212
+ @iteration = Time.now.utc - @start_time
212
213
  data = render(tpl, tpl_file_path, params, current_template_info: current_template_info)
213
214
  not_ready = []
214
215
  ready = 0
215
- @iteration = Time.now.utc - @start_time
216
216
  to_cleanup = []
217
217
  @endpoints.each_pair do |endpoint_key, endpt|
218
218
  if endpt.ready?
219
219
  ready += 1
220
220
  else
221
- not_ready << endpt.endpoint.path
221
+ # We consider only the endpoints usefull with current iteration
222
+ not_ready << endpoint_key unless endpt.seen_at < @iteration
222
223
  end
223
224
  to_cleanup << endpoint_key if (@iteration - endpt.seen_at) > 60
224
225
  end
@@ -1,5 +1,5 @@
1
1
  module Consul
2
2
  module Async
3
- VERSION = '1.15.0'.freeze
3
+ VERSION = '1.15.1'.freeze
4
4
  end
5
5
  end
@@ -79,84 +79,85 @@ class ConsulService {
79
79
  }
80
80
 
81
81
  reloadServiceList() {
82
- if (!this.data || !this.data.services) {
83
- console.log("No data to display");
84
- }
85
82
  this.serviceList.html('');
86
83
  this.serviceFilterCount = 0;
87
84
 
88
85
  let idx = 0;
89
86
  let lastFav = null;
90
- for (var serviceName in this.data.services) {
91
- var service = this.data.services[serviceName];
92
- var serviceStatus = buildServiceStatus(service);
93
-
94
- var listItem = document.createElement('li');
95
- listItem.setAttribute('onfocus','consulService.onClickServiceName(this)');
96
- listItem.setAttribute('onclick','consulService.onClickServiceName(this)');
97
- listItem.setAttribute('value',serviceName);
98
- listItem.setAttribute('data-fav', this.favorites[serviceName] ? 1 : 0);
99
- listItem.setAttribute('data-index', idx);
100
- var listItemClass = 'serviceListItem list-group-item list-group-item-action';
101
-
102
- var statuses = document.createElement('div');
103
- statuses.setAttribute('class','statuses float-right');
104
-
105
- if (!!serviceStatus['passing']) {
106
- statuses.appendChild(createBadge('badge-success passing', serviceStatus['passing']));
107
- listItem.setAttribute('status', 'passing');
108
- }
87
+ if (!this.data || !this.data.services) {
88
+ console.log("No data to display");
89
+ } else {
90
+ for (var serviceName in this.data.services) {
91
+ var service = this.data.services[serviceName];
92
+ var serviceStatus = buildServiceStatus(service);
93
+
94
+ var listItem = document.createElement('li');
95
+ listItem.setAttribute('onfocus','consulService.onClickServiceName(this)');
96
+ listItem.setAttribute('onclick','consulService.onClickServiceName(this)');
97
+ listItem.setAttribute('value',serviceName);
98
+ listItem.setAttribute('data-fav', this.favorites[serviceName] ? 1 : 0);
99
+ listItem.setAttribute('data-index', idx);
100
+ var listItemClass = 'serviceListItem list-group-item list-group-item-action';
101
+
102
+ var statuses = document.createElement('div');
103
+ statuses.setAttribute('class','statuses float-right');
104
+
105
+ if (!!serviceStatus['passing']) {
106
+ statuses.appendChild(createBadge('badge-success passing', serviceStatus['passing']));
107
+ listItem.setAttribute('status', 'passing');
108
+ }
109
109
 
110
- if (!!serviceStatus['warning']) {
111
- statuses.appendChild(createBadge('badge-warning warning', serviceStatus['warning']));
112
- listItem.setAttribute('status', 'warning');
113
- }
110
+ if (!!serviceStatus['warning']) {
111
+ statuses.appendChild(createBadge('badge-warning warning', serviceStatus['warning']));
112
+ listItem.setAttribute('status', 'warning');
113
+ }
114
114
 
115
- if (!!serviceStatus['critical']) {
116
- statuses.appendChild(createBadge('badge-danger critical', serviceStatus['critical']));
117
- listItem.setAttribute('status', 'critical');
118
- }
115
+ if (!!serviceStatus['critical']) {
116
+ statuses.appendChild(createBadge('badge-danger critical', serviceStatus['critical']));
117
+ listItem.setAttribute('status', 'critical');
118
+ }
119
119
 
120
- statuses.appendChild(createBadge('badge-dark', (serviceStatus['total'] || 0)));
120
+ statuses.appendChild(createBadge('badge-dark', (serviceStatus['total'] || 0)));
121
121
 
122
- statuses.append(this.buildFavButton(serviceName));
122
+ statuses.append(this.buildFavButton(serviceName));
123
123
 
124
- listItem.appendChild(statuses);
125
- if (!!service['kind']) {
126
- var kind = document.createElement('div');
127
- kind.setAttribute('class','kind float-right');
128
- kind.appendChild(createBadge('badge-info kind', service['kind']));
129
- listItem.appendChild(kind);
130
- listItemClass+= " kind-" + service['kind'];
131
- }
132
- listItem.setAttribute('class', listItemClass);
124
+ listItem.appendChild(statuses);
125
+ if (!!service['kind']) {
126
+ var kind = document.createElement('div');
127
+ kind.setAttribute('class','kind float-right');
128
+ kind.appendChild(createBadge('badge-info kind', service['kind']));
129
+ listItem.appendChild(kind);
130
+ listItemClass+= " kind-" + service['kind'];
131
+ }
132
+ listItem.setAttribute('class', listItemClass);
133
133
 
134
- var serviceNameItem = document.createElement('div');
135
- serviceNameItem.setAttribute('class', 'service-name');
136
- serviceNameItem.appendChild(document.createTextNode(serviceName));
137
- listItem.appendChild(serviceNameItem);
134
+ var serviceNameItem = document.createElement('div');
135
+ serviceNameItem.setAttribute('class', 'service-name');
136
+ serviceNameItem.appendChild(document.createTextNode(serviceName));
137
+ listItem.appendChild(serviceNameItem);
138
138
 
139
- var serviceTagsItem = document.createElement('div');
140
- serviceTagsItem.setAttribute('class', 'service-tags');
139
+ var serviceTagsItem = document.createElement('div');
140
+ serviceTagsItem.setAttribute('class', 'service-tags');
141
141
 
142
- for (var i = 0; i < service.tags.length; i++) {
143
- serviceTagsItem.appendChild(createBadge('float-right badge-' + (i%2?'secondary':'info') , service.tags[i]));
144
- }
142
+ for (var i = 0; i < service.tags.length; i++) {
143
+ serviceTagsItem.appendChild(createBadge('float-right badge-' + (i%2?'secondary':'info') , service.tags[i]));
144
+ }
145
145
 
146
- listItem.appendChild(serviceTagsItem);
147
- this.serviceFilterCount += 1;
146
+ listItem.appendChild(serviceTagsItem);
147
+ this.serviceFilterCount += 1;
148
148
 
149
- if (this.favorites[serviceName] && lastFav) {
150
- lastFav.after(listItem);
151
- lastFav = listItem;
152
- } else if (this.favorites[serviceName] && !lastFav) {
153
- this.serviceList.prepend(listItem);
154
- lastFav = listItem;
155
- } else {
156
- this.serviceList.append(listItem);
157
- }
149
+ if (this.favorites[serviceName] && lastFav) {
150
+ lastFav.after(listItem);
151
+ lastFav = listItem;
152
+ } else if (this.favorites[serviceName] && !lastFav) {
153
+ this.serviceList.prepend(listItem);
154
+ lastFav = listItem;
155
+ } else {
156
+ this.serviceList.append(listItem);
157
+ }
158
158
 
159
- idx++;
159
+ idx++;
160
+ }
160
161
  }
161
162
  this.serviceFilterCounter.html(this.serviceFilterCount);
162
163
  resizeWrapper('service-wrapper', 'service-list');
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul-templaterb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - SRE Core Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-14 00:00:00.000000000 Z
11
+ date: 2019-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-http-request