Skip to content

SFTP service is not triggered on file changes #656

@chathurace

Description

@chathurace

Description

No response

Steps to Reproduce

Write an SFTP service to listen to a folder (e.g. shown below).
Add a file to the SFTP server's corresponding folder.
onFileChange method in the service is not invoked.

Service:

import ballerina/ftp;
import ballerina/log;

listener ftp:Listener inventoryUpdatesL = new (protocol = ftp:SFTP, path = "/upload", port = 2222, auth = {
credentials: {
username: "foo",
password: "pass"
}
}, host = "localhost", pollingInterval = 3);

service ftp:Service on inventoryUpdatesL {
remote function onFileChange(ftp:WatchEvent & readonly event, ftp:Caller caller) returns error? {
do {
log:printInfo("Files changed.");
} on fail error err {
return error("unhandled error", err);
}
}
}

Version

1.0.5

Environment Details (with versions)

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions