@@ -764,9 +764,11 @@ func (j *DSConfluence) Sync(ctx *shared.Ctx) (err error) {
764
764
// NOTE: Non-generic ends here
765
765
gMaxUpdatedAtMtx .Lock ()
766
766
defer gMaxUpdatedAtMtx .Unlock ()
767
- err = j .cacheProvider .SetLastSync (j .endpoint , gMaxUpdatedAt )
768
- if err != nil {
769
- j .log .WithFields (logrus.Fields {"operation" : "Sync" }).Infof ("unable to set last sync date to cache.error: %v" , err )
767
+ if ! gMaxUpdatedAt .IsZero () {
768
+ err = j .cacheProvider .SetLastSync (j .endpoint , gMaxUpdatedAt )
769
+ if err != nil {
770
+ j .log .WithFields (logrus.Fields {"operation" : "Sync" }).Infof ("unable to set last sync date to cache.error: %v" , err )
771
+ }
770
772
}
771
773
return
772
774
}
@@ -1178,6 +1180,7 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
1178
1180
j .log .WithFields (logrus.Fields {"operation" : "GetModelData" }).Errorf ("GenerateIdentity(%s,%s,%s,%s): %+v for %+v" , source , email , name , username , err , doc )
1179
1181
return
1180
1182
}
1183
+ isBotIdentity := shared .IsBotIdentity (name , username , email , ConfluenceDataSource , os .Getenv ("BOT_NAME_REGEX" ), os .Getenv ("BOT_USERNAME_REGEX" ), os .Getenv ("BOT_EMAIL_REGEX" ))
1181
1184
contributors := []insights.Contributor {
1182
1185
{
1183
1186
Role : insights .AuthorRole ,
@@ -1190,6 +1193,7 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
1190
1193
Username : username ,
1191
1194
Source : ConfluenceDataSource ,
1192
1195
Avatar : avatar ,
1196
+ IsBot : isBotIdentity ,
1193
1197
},
1194
1198
},
1195
1199
}
@@ -1206,6 +1210,7 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
1206
1210
j .log .WithFields (logrus.Fields {"operation" : "GetModelData" }).Errorf ("GenerateIdentity(%s,%s,%s,%s): %+v for %+v" , source , email , name , username , err , doc )
1207
1211
return
1208
1212
}
1213
+ isBotIdentity2 := shared .IsBotIdentity (name , username , email , ConfluenceDataSource , os .Getenv ("BOT_NAME_REGEX" ), os .Getenv ("BOT_USERNAME_REGEX" ), os .Getenv ("BOT_EMAIL_REGEX" ))
1209
1214
contributor := insights.Contributor {
1210
1215
Role : insights .AuthorRole ,
1211
1216
Weight : 1.0 ,
@@ -1217,6 +1222,7 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
1217
1222
Username : username ,
1218
1223
Source : ConfluenceDataSource ,
1219
1224
Avatar : avatar ,
1225
+ IsBot : isBotIdentity2 ,
1220
1226
},
1221
1227
}
1222
1228
contributors = append (contributors , contributor )
@@ -1235,6 +1241,7 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
1235
1241
j .log .WithFields (logrus.Fields {"operation" : "GetModelData" }).Errorf ("GenerateIdentity(%s,%s,%s,%s): %+v for %+v" , source , email , name , username , err , doc )
1236
1242
return
1237
1243
}
1244
+ isBotIdentity2 := shared .IsBotIdentity (name , username , email , ConfluenceDataSource , os .Getenv ("BOT_NAME_REGEX" ), os .Getenv ("BOT_USERNAME_REGEX" ), os .Getenv ("BOT_EMAIL_REGEX" ))
1238
1245
contributor := insights.Contributor {
1239
1246
Role : insights .AuthorRole ,
1240
1247
Weight : 1.0 ,
@@ -1246,6 +1253,7 @@ func (j *DSConfluence) GetModelData(ctx *shared.Ctx, docs []interface{}) (data m
1246
1253
Username : username ,
1247
1254
Source : ConfluenceDataSource ,
1248
1255
Avatar : avatar ,
1256
+ IsBot : isBotIdentity2 ,
1249
1257
},
1250
1258
}
1251
1259
contributors = append (contributors , contributor )
0 commit comments