Feat: location data at /v1/publicip/ip
This commit is contained in:
@@ -70,7 +70,6 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
|
||||
l.stopped <- struct{}{}
|
||||
case ip := <-ipCh:
|
||||
getCancel()
|
||||
l.state.SetPublicIP(ip)
|
||||
|
||||
message := "Public IP address is " + ip.String()
|
||||
result, err := Info(ctx, l.client, ip)
|
||||
@@ -81,6 +80,9 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
|
||||
}
|
||||
l.logger.Info(message)
|
||||
|
||||
result.SetIP(ip)
|
||||
l.state.SetData(result)
|
||||
|
||||
filepath := l.state.GetSettings().IPFilepath
|
||||
err = persistPublicIP(filepath, ip.String(), l.puid, l.pgid)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user