(ctx context.Context, relID, path string)
| 493 | } |
| 494 | |
| 495 | func (s *PostgresStore) syncAuthFile(ctx context.Context, relID, path string) error { |
| 496 | data, err := os.ReadFile(path) |
| 497 | if err != nil { |
| 498 | if errors.Is(err, fs.ErrNotExist) { |
| 499 | return s.deleteAuthRecord(ctx, relID) |
| 500 | } |
| 501 | return fmt.Errorf("postgres store: read auth file: %w", err) |
| 502 | } |
| 503 | if len(data) == 0 { |
| 504 | return s.deleteAuthRecord(ctx, relID) |
| 505 | } |
| 506 | return s.persistAuth(ctx, relID, data) |
| 507 | } |
| 508 | |
| 509 | func (s *PostgresStore) upsertAuthRecord(ctx context.Context, relID, path string) error { |
| 510 | data, err := os.ReadFile(path) |
no test coverage detected