Skip to content

Commit b0bd1b7

Browse files
committed
Cleanup.
Signed-off-by: Alexander Trauzzi <[email protected]>
1 parent ffd638e commit b0bd1b7

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/implementation/Server/HTTPServer/jobs.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,14 @@ limitations under the License.
1313

1414
import IServerJobs from "../../../interfaces/Server/IServerJobs";
1515
import HTTPServer from "./HTTPServer";
16-
import { Logger } from "../../../logger/Logger";
1716
import { TypeDaprJobsCallback } from "../../../types/DaprJobsCallback.type";
1817

1918
export default class HTTPServerJobs implements IServerJobs {
2019

21-
private readonly httpServer: HTTPServer;
22-
private readonly logger: Logger;
20+
constructor(private readonly httpServer: HTTPServer) {}
2321

24-
constructor(httpServer: HTTPServer) {
25-
this.logger = new Logger("HTTPServer", "Jobs", httpServer.client.options.logger);
26-
this.httpServer = httpServer;
27-
}
28-
29-
listen(jobName: string, callback: TypeDaprJobsCallback): void {
22+
listen(jobName: string, callback: TypeDaprJobsCallback) : void;
23+
listen<DataType>(jobName: string, callback: TypeDaprJobsCallback<DataType>): void {
3024
this.httpServer.getServer().post(`/job/${jobName}`, callback);
3125
}
3226
}

src/types/DaprJobsCallback.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ See the License for the specific language governing permissions and
1111
limitations under the License.
1212
*/
1313

14-
export type TypeDaprJobsCallback = (data: any, headers: object) => Promise<any | void>;
14+
export type TypeDaprJobsCallback<DataType = object | string> = (data: DataType, headers: object) => Promise<unknown>;

0 commit comments

Comments
 (0)