-
Notifications
You must be signed in to change notification settings - Fork 0
Add force ondemand api mode #64
Changes from all commits
324d65a
be61bb5
0889695
0574846
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ global.onInstall = (): void => { | |
| const setting = Setting.load() | ||
| setting.setDefaultToken() | ||
| setting.setDefaultOndemandApiEnabled() | ||
| setting.setDefaultOndemandApiCallMode() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. インストール時に従量課金モードの初期状態を
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. これを
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 元々は |
||
| setting.save() | ||
|
|
||
| global.onOpen() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,8 +35,15 @@ export class CsvExporter { | |
|
|
||
| const ondemandQuarterApiPeriodRange = new OndemandApiPeriodRange(companyService) | ||
|
|
||
| const ondemandQuarterApiPeriods = ondemandQuarterApiPeriodRange.selectOndemandQuarterApiPeriod(ticker, range) | ||
| const quarterApiPeriods = ondemandQuarterApiPeriodRange.filterOndemandQuarterApiPeriod(ticker, range) | ||
| let ondemandQuarterApiPeriods = [] | ||
| let quarterApiPeriods = [] | ||
|
|
||
| if (setting.isOndemandApiCallModeForce()) { | ||
| ondemandQuarterApiPeriods = range.range() | ||
| } else { | ||
| ondemandQuarterApiPeriods = ondemandQuarterApiPeriodRange.selectOndemandQuarterApiPeriod(ticker, range) | ||
| quarterApiPeriods = ondemandQuarterApiPeriodRange.filterOndemandQuarterApiPeriod(ticker, range) | ||
| } | ||
|
Comment on lines
-38
to
+46
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CSVのダウンロード機能は、従量課金モードが |
||
|
|
||
| if (ondemandQuarterApiPeriods.length > 0 && !setting.ondemandApiEnabled) { | ||
| throw new Error( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BCODEのquarterとdailyそれぞれに雑にsetting.isOndemandApiCallModeForce()を渡していますが、将来的にはSettingに応じた従量課金の挙動を決定するストラテジークラスみたいなのを実装できると綺麗になりそうです。