mirror of https://gitlab.com/bashrc2/epicyon
Remove federated blocks file if endpoints are removed
parent
8f07fb95f9
commit
00d7012ef9
14
blocking.py
14
blocking.py
|
@ -1976,6 +1976,20 @@ def save_block_federated_endpoints(base_dir: str,
|
||||||
continue
|
continue
|
||||||
block_federated_endpoints_str += endpoint.strip() + '\n'
|
block_federated_endpoints_str += endpoint.strip() + '\n'
|
||||||
result.append(endpoint)
|
result.append(endpoint)
|
||||||
|
if not block_federated_endpoints_str:
|
||||||
|
if os.path.isfile(block_api_endpoints_filename):
|
||||||
|
try:
|
||||||
|
os.remove(block_api_endpoints_filename)
|
||||||
|
except OSError:
|
||||||
|
print('EX: unable to delete block_api_endpoints.txt')
|
||||||
|
block_api_filename = \
|
||||||
|
base_dir + '/accounts/block_api.txt'
|
||||||
|
if os.path.isfile(block_api_filename):
|
||||||
|
try:
|
||||||
|
os.remove(block_api_filename)
|
||||||
|
except OSError:
|
||||||
|
print('EX: unable to delete block_api.txt')
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
with open(block_api_endpoints_filename, 'w+',
|
with open(block_api_endpoints_filename, 'w+',
|
||||||
encoding='utf-8') as fp_api:
|
encoding='utf-8') as fp_api:
|
||||||
|
|
Loading…
Reference in New Issue