Skip to content

Commit

Permalink
no rockdb
Browse files Browse the repository at this point in the history
  • Loading branch information
fucusy committed Oct 1, 2023
1 parent 0b48cd5 commit 12f320f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gomoku/script/tornado_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
import sys

import tornado.ioloop
from divided_solution_manager import apply_all_transformation_for_steps_str, apply_transformation, find_next_steps_from_board_str_db
from tornado import options
from tornado import web
from tornado.log import app_log
import rocksdb

from divided_solution_manager import find_next_steps_from_board_str_hash2action, get_all_step_str2action

options.options["log_file_prefix"] = "tornado_log"
options.parse_command_line()


db = rocksdb.DB("no_restrituion_gomoku.db", rocksdb.Options(create_if_missing=True), read_only=True)
all_step_str2action = get_all_step_str2action()


class MainHandler(tornado.web.RequestHandler):
Expand All @@ -22,7 +21,7 @@ def get(self):
self.set_header('Content-type', 'application/json')
self.set_header('Access-Control-Allow-Origin', '*')
steps_url = self.get_argument("stepsString").strip("_")
possible_moves = find_next_steps_from_board_str_db(steps_url, db)
possible_moves = find_next_steps_from_board_str_hash2action(steps_url, all_step_str2action)

if len(possible_moves) > 0:
next_move = possible_moves[0]
Expand Down

0 comments on commit 12f320f

Please sign in to comment.