Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
Fix logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Cucer committed Feb 7, 2018
1 parent 6952f3b commit 7440624
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "titime",
"productName": "TiTime - Keeping the time for you",
"version": "1.3.0",
"version": "1.3.1",
"description": "Tool for Instant Time Tracking",
"main": "src/index.js",
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions src/remote/redmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ export default class RedmineProvider extends AbstractProvider {
const redmine = this.createClient();

await Promise.all(timeToLog.map((payload) => { // eslint-disable-line
const { hours, issue_id, spent_on } = payload;

Logger.info(
`Log ${payload.hours} hours spent on issue ` +
`#${payload.issue_id} on ${payload.spent_on} to Redmine`,
`Log ${hours} hours spent on issue ` +
`#${issue_id} on ${spent_on} to Redmine`, // eslint-disable-line
);

return pify(redmine.create_time_entry.bind(redmine))(payload);
Expand Down Expand Up @@ -187,7 +189,7 @@ export default class RedmineProvider extends AbstractProvider {
shouldReport(lastReportTime) { // eslint-disable-line class-methods-use-this
if (!lastReportTime) {
return true;
} else if (moment().diff(moment.unix(lastReportTime), 'hours') >= 12) {
} else if (moment.unix(lastReportTime).duration().asDays() >= 1) {
return true;
}

Expand Down

0 comments on commit 7440624

Please sign in to comment.