(cl *ttnredis.Client)
| 137 | } |
| 138 | |
| 139 | func getSchemaVersion(cl *ttnredis.Client) (int, error) { |
| 140 | schemaVersionString, err := cl.Get(ctx, schemaVersionKey(cl)).Result() |
| 141 | if err != nil { |
| 142 | if errors.IsNotFound(ttnredis.ConvertError(err)) { |
| 143 | return 0, nil |
| 144 | } |
| 145 | return 0, err |
| 146 | } |
| 147 | schemaVersion, err := strconv.ParseInt(schemaVersionString, 10, 32) |
| 148 | if err != nil { |
| 149 | return 0, err |
| 150 | } |
| 151 | logger.WithField("version", schemaVersion).Info("Existing database schema version") |
| 152 | return int(schemaVersion), nil |
| 153 | } |
| 154 | |
| 155 | // telemetryConfigFallback sets the UID elements for telemetry if they are empty. |
| 156 | func telemetryConfigFallback(_ context.Context, cfg *Config) { |
no test coverage detected