Giter VIP home page Giter VIP logo

Comments (6)

shmuelk avatar shmuelk commented on May 22, 2024

@lucianboboc I am unable to recreate your failure.

This is what I tried:

1. Created a fresh directory.
2. Created a Package.swift file that contained:
 import PackageDescription 

 let package = Package(
 name: "CouchDB_50",
 dependencies: [
     .Package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", majorVersion: 1, minor: 4),
 ])
3. Created a file main.swift and copied your program from the ghist.
4. Added a few imports that were missing (Foundation, CouchDB, and SwiftyJSON).
5. Ran `swift build` to compile the code
6. Used CouchDB's Web UI to create a database called test
7. Ran `.build/debug/CouchDB_50`

I then get the following output:

update callback
2-4d46b416f975fed36e83d97da3789180

I will also point out that I tried running .build/debug/CouchDB_50 again after having deleting the test database. The program ends immediately with no output. Again as expected.

from kitura-couchdb.

lucianboboc avatar lucianboboc commented on May 22, 2024

Hi @shmuelk, Thank you for your message.
I'm using the Apache CouchDB 2.0 app for macOS and it runs in 'Admin Party' mode.
Indeed, the db object is updated and revision is increased, the issue is not about that, it is about the callback that's never received for the call to the update method:

database.update(id, rev: rev, document: newDocument) { rev, doc, error in
     print("update callback")
}

Have you tried to run in Xcode?
I also tried to run in terminal using ./.build/debug/testApp and i have the same problem, it remains 'waiting' and doesn't end.
I checked again in activity monitor and swap was 40gb...

from kitura-couchdb.

shmuelk avatar shmuelk commented on May 22, 2024

What version of Kitura-CouchDB are you using?

from kitura-couchdb.

lucianboboc avatar lucianboboc commented on May 22, 2024

I'm using package 1.4

from kitura-couchdb.

shmuelk avatar shmuelk commented on May 22, 2024

I ran swift package generate-xcodeproj from the command, opened the generated XCode project using XCode 8.2.1, built the project and ran the project. I got the following output:

update callback
2-4d46b416f975fed36e83d97da3789180
Program ended with exit code: 0

Again your program seems to work for me.

Can you try closing the Apache CouchDB 2.0 app for macOS, when you run the test?

from kitura-couchdb.

lucianboboc avatar lucianboboc commented on May 22, 2024

@shmuelk that was it, seems if i have the couchDB mac app open the update method will never be called and program doesn't end.
Thank you!

from kitura-couchdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.