用 docker 又加左 python scheduler 但又無 print 唔出野

但 call 其他野 print 又無啦啦彈翻晒出黎? 放心你個 schedulrr 同個 program 都無事

solution:

put this in docker-compose

PYTHONUNBUFFERED=1

ChatGPT ans:

If you’re using the apscheduler library in your FastAPI app running in a Docker container, and you’re not seeing print messages in the container logs, it’s possible that the messages are being buffered by the apscheduler library or the Python interpreter, and are not being immediately flushed to the Docker logs.

One way to force the print messages to be immediately flushed to the Docker logs is to set the PYTHONUNBUFFERED environment variable to 1 when running the container. This will disable output buffering in the Python interpreter, and ensure that print messages are immediately written to the Docker logs.

quasar / vue

quasar 就係被你用佢原本 d component, 你想 cus 咩

佢就整左 d slot 被你去 攝/cus

加上 vue d shorthand logic (i.e. v-if, v-for) … props 既幫手就可以輕易咁 整/改 quasar or other 牌子 component

btw 你搞咁多野 vue 下面堆 props,data,methods,computed… 全部都係為左 serve 你上面堆 html template… <== vue 之真諦

-ti (for docker / other ssh/terminal program)

-t 即係 -tty (docker doc 話係 pseudo-TTY) 即係扮 terminal … 而家係 ssh … 但又想扮以前古代既 terminal, 呢個 tty = teletypewriter 好古代 真係有部打字機 但係識射d 電 signal 出黎, 個 -t = tty = terminal 真係扮緊呢個

-i 即係 interactive (docker doc 解釋叫 Keep STDIN open even if not attached) , 呢個 interactive 同而家既解釋要少少分別 , 個 _ 閃閃下俾你打字 俾command 去電腦係古代已經好 interactive … 所以 interactive = 被你入去 >_ 到打 command ; 相反唔 interactive 即係唔洗你入去打 command 直接行 program…

所以簡單黎講 你想用 docker 入 container 做d “interactive” 操作就要 exec -ti

終於明點解 js , py 咁鍾意用 get_XXX() 去 return 個 object

係啊 你可以就咁 inline code

route = APIRouter()

點解係要整個

def get_abc_router(p1, p2) -> APIRouter:
  router = APIRouter()
  @router.get("/verify")
  async def verify(user: User = Depends(current_active_user), parameter using p1, p2):
......
  return router

無錯啦 最重要就係個 p1, p2
你可以週位 import 個 get function, 跟住整新 object 個陣仲可以入 p1, p2 去 config
你無 get_xxx function 都得既, py 直 import 個 var
到時咪無得 config 囉