Skip to content

Commit f2f3087

Browse files
committed
changes to proto used in grpc communication
1 parent c3c2d2b commit f2f3087

File tree

5 files changed

+91
-45
lines changed

5 files changed

+91
-45
lines changed

system/go/wpr/src/analyzer/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ func (a *Analyzer) Analyze(ctx context.Context, arg *pb.AzRequest) (*pb.AzRespon
8787
}
8888
} else {
8989
log.Printf("File %s not found in cache\n", arg.Name)
90+
if arg.Static {
91+
log.Printf("Requested by static crawler, simply sending empty response")
92+
return &pb.AzResponse{Body: ""}, nil
93+
}
9094
if strings.Contains(arg.Type, "javascript") {
9195
atomic.AddInt32(&a.stats.instJS, 1)
9296
} else if strings.Contains(arg.Type, "html") {

system/go/wpr/src/analyzer/proto/analyzer.pb.go

Lines changed: 54 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

system/go/wpr/src/analyzer/proto/analyzer.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ message AzRequest {
1616
string type = 3;
1717
string encoding = 4;
1818
bool caching = 5;
19+
bool static = 6;
1920
}
2021

2122
message AzResponse {

system/node/proto/analyzer.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ message AzRequest {
1616
string type = 3;
1717
string encoding = 4;
1818
bool caching = 5;
19+
bool static = 6;
1920
}
2021

2122
message AzResponse {

system/node/proto/analyzer_pb.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ proto.proto.AzRequest.toObject = function(includeInstance, msg) {
211211
body: jspb.Message.getFieldWithDefault(msg, 2, ""),
212212
type: jspb.Message.getFieldWithDefault(msg, 3, ""),
213213
encoding: jspb.Message.getFieldWithDefault(msg, 4, ""),
214-
caching: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
214+
caching: jspb.Message.getBooleanFieldWithDefault(msg, 5, false),
215+
pb_static: jspb.Message.getBooleanFieldWithDefault(msg, 6, false)
215216
};
216217

217218
if (includeInstance) {
@@ -268,6 +269,10 @@ proto.proto.AzRequest.deserializeBinaryFromReader = function(msg, reader) {
268269
var value = /** @type {boolean} */ (reader.readBool());
269270
msg.setCaching(value);
270271
break;
272+
case 6:
273+
var value = /** @type {boolean} */ (reader.readBool());
274+
msg.setStatic(value);
275+
break;
271276
default:
272277
reader.skipField();
273278
break;
@@ -332,6 +337,13 @@ proto.proto.AzRequest.serializeBinaryToWriter = function(message, writer) {
332337
f
333338
);
334339
}
340+
f = message.getStatic();
341+
if (f) {
342+
writer.writeBool(
343+
6,
344+
f
345+
);
346+
}
335347
};
336348

337349

@@ -425,6 +437,24 @@ proto.proto.AzRequest.prototype.setCaching = function(value) {
425437
};
426438

427439

440+
/**
441+
* optional bool static = 6;
442+
* @return {boolean}
443+
*/
444+
proto.proto.AzRequest.prototype.getStatic = function() {
445+
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false));
446+
};
447+
448+
449+
/**
450+
* @param {boolean} value
451+
* @return {!proto.proto.AzRequest} returns this
452+
*/
453+
proto.proto.AzRequest.prototype.setStatic = function(value) {
454+
return jspb.Message.setProto3BooleanField(this, 6, value);
455+
};
456+
457+
428458

429459

430460

0 commit comments

Comments
 (0)