There are 3 servers: nginx
server, fastapi
server and mysql
server.
nginx
server: web page on /admin/
fastapi
server: api page on /api/select/
mysql
server: stores the data (mysql
version 8.3.0
)
/admin/
page will post to /api/select/
when it is loaded, and /api/select/
will return all the records in table test
.
The wierd thing is: when I insert a new record into table test
using phpmyadmin, it will never be updated to /admin/
. To be more strange, if I $.post
manually in the web page, the post result will be alternately updated and unupdated.
The result of the manual posts
PS: The path /api/admin/select/company/
is aliases as /api/select/
in the question.
If I reboot the server, the post data will be updated.
I have completely no idea why this should happen.
aiomysql
package in myFastAPI
server. I heard that it would not store any caches.autocommit=True
inaiomysql
connection. However, I can't see whyselect
query needscommit
.ORDER BY
clause.