async post

2023-02-21 Thread tubbs
I’ve tried it with newhttpClient and timeout but the timeout is not working in this case. I will look into the possibility using threads. Thank you !

async post

2023-02-21 Thread tubbs
Yes I know for sure there is an issue with the backend. The app will iterate through many rows in a db each one with a url and login credentials etc. Somtimes the backend has a faulty endpoint and my request is hung up and it will never resolve. If that happens, if a request hangs I want the app

async post

2023-02-20 Thread tubbs
Thank you dementera, I have it working more or less exactly like in your example but my problem is that sometimes I'm calling a faulty endpoint. I can not say exactly what is wrong but it will make the post request hanging and it will never resolve and I will never reach the code block if respon

async post

2023-02-20 Thread tubbs
The problem I have is that I'm trying to do an API post login using the httpclient. Sometimes something is wrong on the other end and the call will not get a proper response back. If that happens I need to act on it and cancel the request and move on to the next one in the loop. This is where I

async post

2023-02-20 Thread tubbs
What I have below works now but I'm struggeling with the nim syntax. I found out that there is a proc that would be more perfect -> proc withTimeout[T](https://forum.nim-lang.org/postActivity.xml): owned(Future[bool]) here

async post

2023-02-19 Thread tubbs
thank you geotre, that was it. Inside my asyncProc() where the request was made I was returning the wrong type. Cheers!"

async post

2023-02-17 Thread tubbs
I would like to do the request below in an async manner. From looking at the docs I cant manage to make it work. Would appreciate if someone could point me in the right direction. thanks Something goes wrong here: proc asyncProc(): Future[string] {.async.} = var client

Pass instance to other script

2023-02-15 Thread tubbs
ok, thanks! Great!

Pass instance to other script

2023-02-15 Thread tubbs
If I have a script called tracer.nim and let's say I am using it to trace messages and I import the tracer into my main.nim script and use it with a public proc like => tracer.writeMessage("some message") Now if I have another script called script2.nim and I want to use the tracer there as well

Mysql limit not working

2023-02-07 Thread tubbs
Ok, thanks alot!

Mysql limit not working

2023-02-07 Thread tubbs
WORKS => let entrys = db.getAllRows(sql"SELECT surname FROM the_table WHERE name='John' LIMIT 10") LIMIT AS PARAM NOT WORKING => let entrys = db.getAllRows(sql"SELECT surname FROM the_table WHERE name='John' LIMIT ?","10") I can't manage to pass LIMIT in as a param. If I would pass in name as p

Time compare with now

2023-02-03 Thread tubbs
Thanks alot ingo!

Time compare with now

2023-02-03 Thread tubbs
I'm trying to understand how to use the times module but I don't really get the docs on this. I get a timestamp from a db -> 1517875206 How can I compare this time with now() thanks.

Seq too big I think Error: execution of an external program failed

2022-11-18 Thread tubbs
Jesus, cleaned away some old code I did not use (I thought) and now it works. Thank you for your help and sorry for not seeing this earlier.

Seq too big I think Error: execution of an external program failed

2022-11-18 Thread tubbs
No vps, its running on a normal desktop and to me there is nothing strange going on.

Seq too big I think Error: execution of an external program failed

2022-11-17 Thread tubbs
Found out that my program pushes cpu to the max when looping too many objects and thats why it's killed. Maybe a stupid question but is there a way too do more controlled looping? Thanks

Seq too big I think Error: execution of an external program failed

2022-11-17 Thread tubbs
Im making an sql query and select alot of image names about 2000 per query. I push the names into a seq and attach the seq to myObject as a property. I have about 6 myObjects. Then I am scanning directories associated whith each myObject looking for the images. Depending on if I want to keep or

Seq too big I think Error: execution of an external program failed

2022-11-16 Thread tubbs
I am adding many and quite big Types/Objects and I call them DirCollection to a seq[DirCollection] = @[] After adding a certain number of DirCollectons to the seq I get -> Killed Error: execution of an external program failed: '/home/tubbs/code/br-file-cleaner/brcleaner -env dev -dry

Access type from two different files

2022-10-14 Thread tubbs
Thanks alot!

Access type from two different files

2022-10-14 Thread tubbs
How can I define the type below in file A and make instances of it in file B and C? type Flags* = object file_name:string sheet_name:string

How to check if a string is numeric?

2022-10-13 Thread tubbs
After reading the docs and scanning google and read 1200 discussions on how to check if a string is number in nim I turn to you. Pls how do I do that? Thanks

webscrape

2022-02-09 Thread tubbs
thanks alot

webscrape

2022-02-08 Thread tubbs
I would like to do some webscraping but it seems the parseHtml only deals with non dirty html. What can l use to: 1. Find string inside a html tag. 2. Find all links 2. Find string mathed on pattern. What nimtools can do this? I would like something like beautifulspup for pyhon. Than

How to set filepermissions

2021-02-11 Thread tubbs
Thank you Clonk!!!

How to set filepermissions

2021-02-08 Thread tubbs
Thank you for answering but I am creating the file with nim and the default permissions are wrong so I need to do it dynamically with nim.

How to set filepermissions

2021-02-08 Thread tubbs
Thanks, I have seen this proc in the docs but I'm too much of a newbie to know how to use it properly. Could you pls show me how to implement the proc, Thanks

How to set filepermissions

2021-02-05 Thread tubbs
Can someone please tell me how to set filepermissions on a file. if not isNil(read_file): while read_file.readLine(line): line_num.inc if line_num != target_line: temp_ssl_includes.writeLine(line) temp_ssl_includes.close() # what I would like to do temp_ssl_incluse.setFilePerm

get Seconds of Time.time

2020-10-24 Thread tubbs
Thank u Vindaar!

get Seconds of Time.time

2020-10-24 Thread tubbs
total newbie here, trying to find a fast way to check if files inside a dir has changed. Im checking the the fileinfo with getFileInfo() function and I want to read lastWriteTime.seconds but it is impossible. I can read lastWriteTime but I cant get seconds or nanoseconds on what appears to be an