Fixes 4,5: Content watcher sets automation status and moves files to processed/

Fix 4: Content watcher now sets ClickUp task to "automation underway" after
matching, matching the behavior of the link building watcher.

Fix 5: Content watcher now moves .xlsx files to a processed/ subfolder on
success, preventing re-processing on subsequent scans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix/customer-field-migration
PeninsulaInd 2026-02-27 16:01:57 -06:00
parent c80d237e36
commit 8c82ccf2de
1 changed files with 14 additions and 0 deletions

View File

@ -1048,6 +1048,10 @@ class Scheduler:
task_id = matched_task.id
log.info("Matched '%s' to ClickUp task %s (%s)", filename, task_id, matched_task.name)
# Set ClickUp status to "automation underway"
client = self._get_clickup_client()
client.update_task_status(task_id, self.config.clickup.automation_status)
self._notify(
f"Content watcher: matched **{filename}** to ClickUp task "
f"**{matched_task.name}**.\nStarting content creation pipeline...",
@ -1091,6 +1095,16 @@ class Scheduler:
category="content",
)
else:
# Success — move file to processed/
processed_dir = xlsx_path.parent / "processed"
processed_dir.mkdir(exist_ok=True)
dest = processed_dir / filename
try:
shutil.move(str(xlsx_path), str(dest))
log.info("Moved %s to %s", filename, dest)
except OSError as e:
log.warning("Could not move %s to processed: %s", filename, e)
self.db.kv_set(
kv_key,
json.dumps(