File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -151,13 +151,13 @@ func (j *CheckClientIpJob) processLogFile() bool {
151
151
}
152
152
sort .Strings (ips )
153
153
154
- inboundClientIps , err := j .getInboundClientIps (email )
154
+ clientIpsRecord , err := j .getInboundClientIps (email )
155
155
if err != nil {
156
156
j .addInboundClientIps (email , ips )
157
157
continue
158
158
}
159
159
160
- shouldCleanLog = j .updateInboundClientIps (inboundClientIps , email , ips ) || shouldCleanLog
160
+ shouldCleanLog = j .updateInboundClientIps (clientIpsRecord , email , ips ) || shouldCleanLog
161
161
}
162
162
163
163
return shouldCleanLog
@@ -309,12 +309,12 @@ func (j *CheckClientIpJob) updateInboundClientIps(inboundClientIps *model.Inboun
309
309
310
310
func (j * CheckClientIpJob ) getInboundByEmail (clientEmail string ) (* model.Inbound , error ) {
311
311
db := database .GetDB ()
312
- var inbounds * model.Inbound
312
+ inbound := & model.Inbound {}
313
313
314
- err := db .Model (model.Inbound {}).Where ("settings LIKE ?" , "%" + clientEmail + "%" ).Find ( & inbounds ).Error
314
+ err := db .Model (& model.Inbound {}).Where ("settings LIKE ?" , "%" + clientEmail + "%" ).First ( inbound ).Error
315
315
if err != nil {
316
316
return nil , err
317
317
}
318
318
319
- return inbounds , nil
319
+ return inbound , nil
320
320
}
You can’t perform that action at this time.
0 commit comments