Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Nov 4, 2024
1 parent dd199f1 commit b9faade
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
run: just install
- run: |
uv run dnsm update examples/simple.toml
env:
TENCENTCLOUD_SECRET_ID: ${{ secrets.TENCENTCLOUD_SECRET_ID }}
TENCENTCLOUD_SECRET_KEY: ${{ secrets.TENCENTCLOUD_SECRET_KEY }}
LEXICON_CLOUDFLARE_AUTH_TOKEN: ${{ secrets.LEXICON_CLOUDFLARE_AUTH_TOKEN }}
- name: Run tests and benchmarks ✅
uses: CodSpeedHQ/action@v3
env:
Expand Down
21 changes: 12 additions & 9 deletions dns_manager/setter/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,18 @@ def update_dns(self, remove_unmanaged: bool = False):
records.append((subdomain, record.value))
logger.warning(f"([red]🔓 Unmanaged[/]) {record}")
path = Path("~/.config/dns-manager/unmanaged.json")
save_config(
path,
Config(
domain=self.domain,
setter_name=self.setter_name,
records=records,
).model_dump(),
)
logger.info(f"Unmanaged records saved to [bold purple]{path}[/].")
try:
save_config(
path,
Config(
domain=self.domain,
setter_name=self.setter_name,
records=records,
).model_dump(),
)
logger.info(f"Unmanaged records saved to [bold purple]{path}[/].")
except Exception as e:
logger.warning(f"Failed to save unmanaged records: {e}")
for subdomain, record in new_records.items():
cached_record = self.cached_records.get(subdomain, None)
if cached_record is None:
Expand Down

0 comments on commit b9faade

Please sign in to comment.