Skip to content

Commit

Permalink
Hide debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Aug 24, 2024
1 parent 15819db commit e4850b4
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hypha-rpc",
"version": "0.20.28",
"version": "0.20.29",
"description": "Hypha RPC client for connecting to Hypha server for data management and AI model serving.",
"main": "index.js",
"types": "index.d.ts",
Expand Down
38 changes: 19 additions & 19 deletions javascript/src/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export class RPC extends MessageEmitter {
await manager.registerService(serviceInfo);
}
} else {
console.debug("Connection established", connectionInfo);
// console.debug("Connection established", connectionInfo);
}
if (connectionInfo) {
if (connectionInfo.public_base_url) {
Expand Down Expand Up @@ -445,7 +445,7 @@ export class RPC extends MessageEmitter {
throw new Error(`Message with key ${key} does not exists.`);
}
cache[key] = concatArrayBuffers(cache[key]);
console.debug(`Processing message ${key} (bytes=${cache[key].byteLength})`);
// console.debug(`Processing message ${key} (bytes=${cache[key].byteLength})`);
let unpacker = decodeMulti(cache[key]);
const { done, value } = unpacker.next();
const main = value;
Expand All @@ -462,10 +462,10 @@ export class RPC extends MessageEmitter {
Object.assign(main, extra.value);
}
this._fire(main["type"], main);
console.debug(
this._client_id,
`Processed message ${key} (bytes=${cache[key].byteLength})`,
);
// console.debug(
// this._client_id,
// `Processed message ${key} (bytes=${cache[key].byteLength})`,
// );
delete cache[key];
}

Expand Down Expand Up @@ -904,9 +904,9 @@ export class RPC extends MessageEmitter {
data.slice(start_byte, start_byte + CHUNK_SIZE),
!!session_id,
);
console.debug(
`Sending chunk ${idx + 1}/${chunk_num} (${total_size} bytes)`,
);
// console.debug(
// `Sending chunk ${idx + 1}/${chunk_num} (${total_size} bytes)`,
// );
}
// console.log(`All chunks sent (${chunk_num})`);
await message_cache.process(message_id, !!session_id);
Expand Down Expand Up @@ -1066,7 +1066,7 @@ export class RPC extends MessageEmitter {
._send_chunks(message_package, target_id, remote_parent)
.then(function () {
if (timer) {
console.debug(`Start watchdog timer.`);
// console.debug(`Start watchdog timer.`);
// Only start the timer after we send the message successfully
timer.start();
}
Expand Down Expand Up @@ -1150,7 +1150,7 @@ export class RPC extends MessageEmitter {
if (promise.heartbeat && promise.interval) {
async function heartbeat() {
try {
console.debug("Reset heartbeat timer: " + data.method);
// console.debug("Reset heartbeat timer: " + data.method);
await promise.heartbeat();
} catch (err) {
console.error(err);
Expand All @@ -1165,7 +1165,7 @@ export class RPC extends MessageEmitter {
try {
method = indexObject(this._object_store, data["method"]);
} catch (e) {
console.debug("Failed to find method", method_name, this._client_id, e);
// console.debug("Failed to find method", method_name, this._client_id, e);
throw new Error(
`Method not found: ${method_name} at ${this._client_id}`,
);
Expand Down Expand Up @@ -1255,7 +1255,7 @@ export class RPC extends MessageEmitter {
`Runtime Error: Invalid number of arguments for method ${method_name}, expected ${method.length} but got ${args.length}`,
);
}
console.debug("Executing method: " + method_name);
// console.debug("Executing method: " + method_name);
if (data.promise) {
const result = method.apply(null, args);
if (result instanceof Promise) {
Expand All @@ -1279,7 +1279,7 @@ export class RPC extends MessageEmitter {
} catch (err) {
if (reject) {
reject(err);
console.debug("Error during calling method: ", err);
// console.debug("Error during calling method: ", err);
} else {
console.error("Error during calling method: ", err);
}
Expand Down Expand Up @@ -1351,11 +1351,11 @@ export class RPC extends MessageEmitter {
const _server = aObject.__rpc_object__._rserver || this._server_base_url;
if (_server === this._server_base_url) {
return aObject.__rpc_object__;
} else {
console.debug(
`Encoding remote function from a different server ${_server}, current server: ${this._server_base_url}`,
);
}
} // else {
// console.debug(
// `Encoding remote function from a different server ${_server}, current server: ${this._server_base_url}`,
// );
// }
}

let bObject;
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/websocket-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ export class LocalWebSocket {
(event) => {
const { type, data, to } = event.data;
if (to !== this.client_id) {
console.debug("message not for me", to, this.client_id);
// console.debug("message not for me", to, this.client_id);
return;
}
switch (type) {
Expand Down
2 changes: 1 addition & 1 deletion python/hypha_rpc/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.20.28"
"version": "0.20.29"
}
8 changes: 4 additions & 4 deletions python/hypha_rpc/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1316,10 +1316,10 @@ def _encode(
_server = a_object.__rpc_object__.get("_rserver", self._server_base_url)
if _server == self._server_base_url:
return a_object.__rpc_object__
else:
logger.debug(
f"Encoding remote function from a different server {_server}, current server: {self._server_base_url}"
)
# else:
# logger.debug(
# f"Encoding remote function from a different server {_server}, current server: {self._server_base_url}"
# )

# skip if already encoded
if isinstance(a_object, dict) and "_rtype" in a_object:
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "hypha_rpc"
version = "0.20.28"
version = "0.20.29"
description = "Hypha RPC client for connecting to Hypha server for data management and AI model serving"
readme = "README.md"
requires-python = ">=3.6"
Expand Down

0 comments on commit e4850b4

Please sign in to comment.