PR

【9/7】技玉シミュレータ自動実行 #2256

wada opened this at 2022-09-02T18:17:50; closed

Description

opened by wada at 2022-09-02T18:17:50; updated 2022-09-07T16:57:12

概要

【管理画面】技玉販売管理 #2196
シミュレータ実行時のエラーを修正
スクリプトを一定時間置きに実行するようcron設定
スクリプト内で、専用テーブルに設定されたコマンドを実行し結果を格納

テーブル

CREATE TABLE `queue_info` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `type` int(10) unsigned NOT NULL,
  `type_value` int(10) unsigned NOT NULL,
  `command` varchar(255) NOT NULL DEFAULT '',
  `result_json` json DEFAULT NULL,
  `executed` tinyint(3) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

テスト方法、確認した内容

管理画面「技玉ガチャ販売管理」のラインナップ編集からラインナップ変更を実行
queue_infoテーブルにデータが3件入っているか確認(3回実施するため)
ローカル環境で、tool_queue_exec.incを実行
queue_info.result_jsonに3件とも結果が入っているか

result_jsonの実行結果が、以下の数値と大きなズレがないか
(購入回数が500~600回程度ならok)

総購入回数:547
総購入金額:1,641,000

総購入回数:573
総購入金額:1,719,000

総購入回数:563
総購入金額:1,689,000

TODO

tool_queue_exec.incをcron設定

wada add_label at 2022-09-02T18:40:27: レビュー待ち

Comment

#22077 by wada at 2022-09-02T18:41:53; updated 2022-09-02T18:41:53

@kouho
レビューお願いします。

Comment

#22142 by kouho at 2022-09-07T14:41:37; updated 2022-09-07T14:41:37

@wada
確認OKですシミュレーター結果は以下のように出ました。

-- 1回目 --
総購入回数:558	総購入金額:1,674,000

-- 2回目 --
総購入回数:575	総購入金額:1,725,000

-- 3回目 --
総購入回数:578	総購入金額:1,734,000
kouho add_label at 2022-09-07T14:41:40: 皇甫 LGTM
wada merge at 2022-09-07T16:55:42: 【9/7】技玉シミュレータ自動実行
wada close at 2022-09-07T16:55:42: Close
wada delete_branch at 2022-09-07T16:57:12: skill_ball_simulator

Commit range

base30d6dedbb2bf6ea01b592908972ecd7d5c8cf643
head479ed90b610d27d04b060572ba7b90103aa795ac
base branchjolly/jr-web:develop
head branchjolly/jr-web:skill_ball_simulator

View commits

Commit details are loaded from Git when a dynamic archive server is running, or can be embedded with --include-commits.
Files changed4 filesView patch
statusfile
modifiedlib/SubFunc.inc
addedlib/exec/tool_queue_exec.inc
addedlib/models/dao/queue_info.php
modifiedtool/monthly_skillball_gacha_simulator.php
Patch body is stored as a separate file to keep this page lightweight.