"When A File Is Added Or Modified" 触发器适用于更新的文件但不适用于创建的文件

"When A File Is Added Or Modified" trigger works for updated files but not created ones

我有一个 Logic App 设置来监控一个 ftp 网站,该网站在上传文件时应该触发一个动作。如果我上传文件,更改原始文件并再次上传,触发火灾。简单地添加一个文件是行不通的。

很可能您的 FTP 客户端保留了上次文件更改的时间戳。更改此项以使其也触发新添加的文件。

FTP triggers work by polling the FTP file system and looking for any file that was changed since the last poll. Some tools let you preserve the timestamp when the files change. In these cases, you have to disable this feature so your trigger can work. Here are some common settings:

SFTP client Action
Winscp Go to Options > Preferences > Transfer > Edit > Preserve timestamp > Disable
FileZilla Go to Transfer > Preserve timestamps of transferred files > Disable

摘自 HOW FTP TRIGGERS WORK.

除此之外,请注意实际触发器的延迟最多可达触发器轮询间隔的两倍:

When a trigger finds a new file, the trigger checks that the new file is complete, and not partially written. For example, a file might have changes in progress when the trigger checks the file server. To avoid returning a partially written file, the trigger notes the timestamp for the file that has recent changes, but doesn't immediately return that file. The trigger returns the file only when polling the server again. Sometimes, this behavior might cause a delay that is up to twice the trigger's polling interval.