Skip to content

Commit

Permalink
Merge pull request #27 from k2tzumi:fix-this-is-not-function
Browse files Browse the repository at this point in the history
Fix this is not function
  • Loading branch information
k2tzumi authored Mar 5, 2023
2 parents f05a5e1 + 7c16ee3 commit ed376b6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .tagpr
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
releaseBranch = main
versionFile = package.json
majorLabels = major
minorLabels = enhancement,minor
minorLabels = enhancement,minor
command = "make prerelease_for_tagpr"
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,10 @@ clean:
undeploy: ## all undeploy Google apps scripts
undeploy:
$(CLASP) undeploy --all


.PHONY: prerelease_for_tagpr
prerelease_for_tagpr: ## Pre release for tagpr
prerelease_for_tagpr:
npm update
git add package-lock.json
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/JobBroker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ class JobBroker<T extends Parameter> {
scriptLock.releaseLock();

console.info(
`job starting. id: ${parameter.id}, created_at: ${parameter.created_at}, start_at: ${parameter.start_at}, parameter: ${parameter.parameter}`
`job starting. id: ${parameter.id}, handler: ${parameter.handler}, created_at: ${parameter.created_at}, start_at: ${parameter.start_at}, parameter: ${parameter.parameter}`
);

try {
const result = this[parameter.handler](
const foo = window;
const result = foo.eval(parameter.handler)(
JSON.parse(parameter.parameter)
);
if (!result) {
Expand All @@ -104,14 +105,14 @@ class JobBroker<T extends Parameter> {
parameter.end_at = this.now;
this.saveJob(popJob);
console.info(
`job success. id: ${parameter.id}, created_at: ${parameter.created_at}, start_at: ${parameter.start_at}, start_at: ${parameter.end_at}, parameter: ${parameter.parameter}`
`job success. id: ${parameter.id}, handler: ${parameter.handler}, created_at: ${parameter.created_at}, start_at: ${parameter.start_at}, start_at: ${parameter.end_at}, parameter: ${parameter.parameter}`
);
} catch (e) {
parameter.state = "failed";
parameter.end_at = this.now;
this.saveJob(popJob);
console.warn(
`job failed. message: ${e.message}, stack: ${e.stack}, id: ${parameter.id}, created_at: ${parameter.created_at}, start_at: ${parameter.start_at}, start_at: ${parameter.end_at}, parameter: ${parameter.parameter}`
`job failed. message: ${e.message}, stack: ${e.stack}, id: ${parameter.id}, handler: ${parameter.handler}, created_at: ${parameter.created_at}, start_at: ${parameter.start_at}, start_at: ${parameter.end_at}, parameter: ${parameter.parameter}`
);

this.purgeTimeoutQueue();
Expand Down

0 comments on commit ed376b6

Please sign in to comment.