Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/service/app_svc.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ async def watch_ability_files(self):
files = (os.path.join(rt, fle) for rt, _, f in os.walk(p.data_dir+'/abilities') for fle in f if
time.time() - os.stat(os.path.join(rt, fle)).st_mtime < int(self.get_config('ability_refresh')))
for f in files:
if not f.endswith('.yml'):
self.log.debug('[%s] Skipping non YML file %s' % (p.name, f))
Comment on lines +210 to +211
Copy link

Copilot AI Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file extension check is case-sensitive and only matches '.yml'. YAML files can also have '.yaml' extension, which would be skipped by this filter. Consider using a case-insensitive check that accepts both '.yml' and '.yaml' extensions.

Suggested change
if not f.endswith('.yml'):
self.log.debug('[%s] Skipping non YML file %s' % (p.name, f))
if not f.lower().endswith(('.yml', '.yaml')):
self.log.debug('[%s] Skipping non YAML file %s' % (p.name, f))

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timbrigham-oc

thoughts on this suggestion? I'd keep the tuple part but discard the lower() since the file extensions on linux will be case-sensitive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uruwhy that's fair, my usually background is on windows hosts, so I make everything case insensitive.
Big thing I was shooting for was avoiding crashing my instance by reading binary temp files.

continue
self.log.debug('[%s] Reloading %s' % (p.name, f))
await self.get_service('data_svc').load_ability_file(filename=f, access=p.access)
await asyncio.sleep(int(self.get_config('ability_refresh')))
Expand Down