Skip to content

Commit

Permalink
Fix time execute
Browse files Browse the repository at this point in the history
  • Loading branch information
topilski committed Feb 14, 2015
1 parent b401dbd commit 1aed3a4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
12 changes: 12 additions & 0 deletions src/core/events/events_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ namespace fastoredis

}

EventInfoBase::EventInfoBase(const common::time64_t time_start, const error_type &er)
: base_class(er), time_start_(time_start)
{

}

common::time64_t EventInfoBase::elapsedTime() const
{
return common::time::current_mstime() - time_start_;
Expand Down Expand Up @@ -101,6 +107,12 @@ namespace fastoredis

}

CommandRootCompleatedInfo::CommandRootCompleatedInfo(common::time64_t timest, FastoObjectIPtr root, const error_type &er)
: base_class(timest, er), root_(root)
{

}

DisonnectInfoRequest::DisonnectInfoRequest(const error_type &er)
: base_class(er)
{
Expand Down
3 changes: 2 additions & 1 deletion src/core/events/events_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace fastoredis
{
typedef common::utils_qt::EventInfo<common::ErrorValueSPtr > base_class;
EventInfoBase(const error_type &er = error_type());

EventInfoBase(const common::time64_t time_start, const error_type &er = error_type());
common::time64_t elapsedTime() const;

private:
Expand Down Expand Up @@ -122,6 +122,7 @@ namespace fastoredis
{
typedef EventInfoBase base_class;
CommandRootCompleatedInfo(FastoObjectIPtr root, const error_type &er = error_type());
CommandRootCompleatedInfo(common::time64_t timest, FastoObjectIPtr root, const error_type &er = error_type());

FastoObjectIPtr root_;
};
Expand Down
4 changes: 2 additions & 2 deletions src/core/idriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ namespace fastoredis
}

IDriver::RootLocker::RootLocker(IDriver* parent, QObject *reciver, const std::string &text)
: parent_(parent), reciver_(reciver)
: parent_(parent), reciver_(reciver), tstart_(common::time::current_mstime())
{
DCHECK(parent_);
root_ = createRoot(reciver, text);
}

IDriver::RootLocker::~RootLocker()
{
events::CommandRootCompleatedEvent::value_type res(root_);
events::CommandRootCompleatedEvent::value_type res(tstart_, root_);
parent_->reply(reciver_, new events::CommandRootCompleatedEvent(parent_, res));
}

Expand Down
1 change: 1 addition & 0 deletions src/core/idriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ namespace fastoredis

IDriver* parent_;
QObject* reciver_;
const common::time64_t tstart_;
};

RootLocker make_locker(QObject* reciver, const std::string& text)
Expand Down

0 comments on commit 1aed3a4

Please sign in to comment.