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
parent
c80d237e36
commit
8c82ccf2de
|
|
@ -1048,6 +1048,10 @@ class Scheduler:
|
||||||
task_id = matched_task.id
|
task_id = matched_task.id
|
||||||
log.info("Matched '%s' to ClickUp task %s (%s)", filename, task_id, matched_task.name)
|
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(
|
self._notify(
|
||||||
f"Content watcher: matched **{filename}** to ClickUp task "
|
f"Content watcher: matched **{filename}** to ClickUp task "
|
||||||
f"**{matched_task.name}**.\nStarting content creation pipeline...",
|
f"**{matched_task.name}**.\nStarting content creation pipeline...",
|
||||||
|
|
@ -1091,6 +1095,16 @@ class Scheduler:
|
||||||
category="content",
|
category="content",
|
||||||
)
|
)
|
||||||
else:
|
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(
|
self.db.kv_set(
|
||||||
kv_key,
|
kv_key,
|
||||||
json.dumps(
|
json.dumps(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue