首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用mongoDB时,G-WAN的行为异常

使用mongoDB时,G-WAN的行为异常
EN

Stack Overflow用户
提问于 2013-04-26 14:44:01
回答 1查看 181关注 0票数 1

我正在与G-WAN和mongoDB合作,我有一个奇怪的行为。当我显示我的页面时,它看起来没问题。如果我刷新它,它将在刷新5或6次后停止工作。

下面是代码

代码语言:javascript
复制
// ============================================================================
// C servlet sample for the G-WAN Web Application Server (http://trustleap.ch/)
// ----------------------------------------------------------------------------
// mongodb.c: querying mongoDB from G-WAM
// ============================================================================

#pragma link "mongoc"
#pragma link "bson"

#include <mongo.h>
#include <bson.h>
#include "gwan.h" // G-WAN exported functions

int main(int argc, char *argv[])
{
  u64 start = getus();
  xbuf_t *reply = get_reply(argv);
  mongo conn[1];
  int status = mongo_client( conn, "localhost", 27017 );

  if( status != MONGO_OK ) {
    xbuf_xcat(reply, "ERROR MONGO %d", status);

  }

  int i = 0;
  for(i=0; i<2;i++) {
    bson b[1];
    bson_init( b );
    bson_append_new_oid( b, "_id" );
    bson_append_string( b, "name", "Joe" );
    bson_append_int( b, "age", 33 );
    bson_finish( b );
    mongo_insert( conn, "tutorial.people", b, NULL );
    bson_destroy( b );
  }

  xbuf_xcat(reply, "Hello Mongo !! %llU %d %d %llU micro seconds", getus(), status, i, (getus() - start));

  mongo_destroy(conn);
  return 200;
}
// ============================================================================
// End of Source Code
// ============================================================================

日志里没什么特别的.

代码语言:javascript
复制
[Fri Apr 26 06:36:57 2013 GMT] 127.0.0.1 "GET /?forum.c" 200 60 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0"

浏览器似乎已冻结,getus()值未刷新...就像显示一个g-wan缓存版本一样...

更新我认为这是G-WAN内部缓存问题...更改我的url并添加一些参数将刷新页面...

谢谢你的帮助。

EN

回答 1

Stack Overflow用户

发布于 2013-04-29 14:43:47

在这个版本中,微缓存的寿命显然太长了,但如何绕过它是well-documented

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16230262

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档