Skip to content

Commit 612e9bf

Browse files
authored
Make pub_int configurable from pythd (#245)
* Increase default pub_int to 1s * Make pub_int configurable from pythd
1 parent 91bf004 commit 612e9bf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pc/manager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using namespace pc;
99
#define PC_RPC_HTTP_PORT 8899
1010
#define PC_RECONNECT_TIMEOUT (120L*1000000000L)
1111
#define PC_BLOCKHASH_TIMEOUT 3
12-
#define PC_PUB_INTERVAL (400L*PC_NSECS_IN_MSEC)
12+
#define PC_PUB_INTERVAL PC_NSECS_IN_SEC
1313
#define PC_RPC_HOST "localhost"
1414
#define PC_MAX_BATCH 8
1515
// Flush partial batches if not completed within 400 ms.

pcapps/pythd.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ int usage()
4141
<< std::endl;
4242
std::cerr << " Host name or IP address of running pyth_tx server\n"
4343
<< std::endl;
44+
std::cerr << " -i <interval with which to send notify_price_sched notifications, in milliseconds (default 1000) >" << std::endl;
4445
std::cerr << " -k <key_store_directory (default " << get_key_store()
4546
<< ")>]" << std::endl;
4647
std::cerr << " Directory name housing publishing, mapping and program"
@@ -102,14 +103,16 @@ int main(int argc, char **argv)
102103
std::string tx_host = get_tx_host();
103104
int pyth_port = get_port();
104105
int opt = 0;
106+
int pub_int = 1000;
105107
unsigned max_batch_size = 0;
106108
bool do_wait = true, do_tx = true, do_ws = true, do_debug = false;
107-
while( (opt = ::getopt(argc,argv, "r:s:t:p:k:w:c:l:m:b:dnxhz" )) != -1 ) {
109+
while( (opt = ::getopt(argc,argv, "r:s:t:p:i:k:w:c:l:m:b:dnxhz" )) != -1 ) {
108110
switch(opt) {
109111
case 'r': rpc_host = optarg; break;
110112
case 's': secondary_rpc_host = optarg; break;
111113
case 't': tx_host = optarg; break;
112114
case 'p': pyth_port = ::atoi(optarg); break;
115+
case 'i': pub_int = ::atoi(optarg); break;
113116
case 'k': key_dir = optarg; break;
114117
case 'c': cap_file = optarg; break;
115118
case 'w': cnt_dir = optarg; break;
@@ -149,6 +152,7 @@ int main(int argc, char **argv)
149152
mgr.set_do_ws( do_ws );
150153
mgr.set_do_capture( !cap_file.empty() );
151154
mgr.set_commitment( cmt );
155+
mgr.set_publish_interval( pub_int );
152156

153157
bool do_secondary = !secondary_rpc_host.empty();
154158
if ( do_secondary ) {

0 commit comments

Comments
 (0)