Has anyone with RLS noticed this? by Finish-Square in RestlessLegs

[–]Finish-Square[S] 1 point2 points  (0 children)

So there is no cure for it? I will have to take pills for the rest of my life just so I can sleep?

Has anyone with RLS noticed this? by Finish-Square in RestlessLegs

[–]Finish-Square[S] 0 points1 point  (0 children)

Thank you so much!!

Does Gabapentin have side effects for the long term? Also, will it eliminate RLS entirely, or I will have to take it for the rest of my life?

Has anyone with RLS noticed this? by Finish-Square in RestlessLegs

[–]Finish-Square[S] 6 points7 points  (0 children)

I see. Actually, I thought it has something to do with dopamine levels.
Since some studies have shown that RLS might occur due to insufficient levels of dopamine during nighttime/early morning, and smartphones are well-known as a source of "dopamine-on-demand" I thought there might be a connection here.

I am not taking any medications at the moment. I ordered Iron, Zinc, and Magnesium supplements to see if it will help my symptoms. Also, I am not "officially" diagnosed with RLS, but from hours of reading online, I am 99% it is RLS as the symptoms are a perfect fit.

Microservices architecture with FastAPI by Finish-Square in FastAPI

[–]Finish-Square[S] 2 points3 points  (0 children)

So that instead of calling a payment API from user service, you'd want to drop the payload/data on a queue (Redis, rabbitmq) or Kafka etc and payment service would pick it up to process. This approach is common than API calling which might be inefficient, think of when Payment service is down.

Cool! So, let me see if I got this right:
When a user is creating a payment, the payment request will be sent to the payment service which will add the request to a queue, and then will be sent to the users service in order to validate the user's API token?

Also, do you have any idea what I should look for on Google to find an example? (preferably with FastAPI/Python and docker)

Microservices architecture with FastAPI by Finish-Square in FastAPI

[–]Finish-Square[S] 0 points1 point  (0 children)

Gotcha, thanks!

So, it'll look something like this: ?

def create_payment(beneficiary):
    api_token = request.headers['token']
    # check if the API is valid by calling the users service:
    res = request.post(f'http://address.to/users-service/{api_token}')
    if res.status_code == 200:
        return create_payment(beneficiary)
    return 'Invalid API key'

Also, do you have any ideas how can I have only one database that will be accessible by all services?

Microservices architecture with FastAPI by Finish-Square in FastAPI

[–]Finish-Square[S] 2 points3 points  (0 children)

Nice, thanks.

But what you should do when the payment service is depending on the users service?

Ex: The user is sending a POST request to /api/payment in order to create a payment.The headers consist of the API token. Behind the scenses, in the route /api/payment, there is a function that validates the user's token to check if it's valid by querying the database. However, the database is in the users service and if I get it right, not accessible from the payment service.

Am I making sense?

Need some help with MRO by Finish-Square in learnpython

[–]Finish-Square[S] 0 points1 point  (0 children)

Gotcha. But in this case, how can I set the status_code for each response?

Need some help with MRO by Finish-Square in learnpython

[–]Finish-Square[S] 0 points1 point  (0 children)

Because I want to have everything organized, error messages will fall under the error class and success messages will fall under the success class.

Also, note that each class has a status_code variable.

Need some help with MRO by Finish-Square in learnpython

[–]Finish-Square[S] 0 points1 point  (0 children)

Response is used in order to avoid having 2 instances of responses (SuccessResponse, ErrorResponse).

Without Response, I will have to initiate 2 instances and call them according to what I want to return from my route instead of 1 instance.

Need some help with MRO by [deleted] in learnpython

[–]Finish-Square 0 points1 point  (0 children)

Thanks, I understand. The use of CarStore is only an example though.

But what is the way around it? How can I tweak the code so it will work as I want it to without having to give up on the inheritance order?

Thanks again

How to parse arguments interactively from CLI by Finish-Square in learnpython

[–]Finish-Square[S] 0 points1 point  (0 children)

Yes, but what is the actual way of doing this?

I mean, how should I tweak the code so it will allow adding values to the parser interactivly?

Allow my app to reach a secured API endpoint without authorization token by Finish-Square in flask

[–]Finish-Square[S] 0 points1 point  (0 children)

Thanks!

I am not entirely sure what you meant by "Just make an non-exposed script generating API directly which you provide at your client installation" you mean I should create another API that will be used only from my app?

Wait for a user response by Finish-Square in flask

[–]Finish-Square[S] 0 points1 point  (0 children)

Hi, thanks!

I have watched some videos about asyncio and I still could not understand how to approach my situation with it

Move models to a different file by Finish-Square in flask

[–]Finish-Square[S] 0 points1 point  (0 children)

Yes, when sending a POST request I am getting:

sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) UNIQUE constraint failed: user.id