Skip to content

Commit ce79a31

Browse files
olegrokfilonenko-mikhail
authored andcommitted
fix typos and remove unused variables in init.lua
1 parent 6e8ac71 commit ce79a31

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

kafka/init.lua

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function Consumer:_poll_msg()
5858
end
5959
fiber.yield()
6060
else
61-
-- throtling poll
61+
-- throttling poll
6262
fiber.sleep(0.01)
6363
end
6464
end
@@ -72,12 +72,12 @@ function Consumer:_poll_logs()
7272
count, err = self._consumer:poll_logs(100)
7373
if err ~= nil then
7474
log.error("Consumer poll logs error: %s", err)
75-
-- throtling poll
75+
-- throttling poll
7676
fiber.sleep(0.1)
7777
elseif count > 0 then
7878
fiber.yield()
7979
else
80-
-- throtling poll
80+
-- throttling poll
8181
fiber.sleep(1)
8282
end
8383
end
@@ -91,12 +91,12 @@ function Consumer:_poll_errors()
9191
count, err = self._consumer:poll_errors(100)
9292
if err ~= nil then
9393
log.error("Consumer poll errors error: %s", err)
94-
-- throtling poll
94+
-- throttling poll
9595
fiber.sleep(0.1)
9696
elseif count > 0 then
9797
fiber.yield()
9898
else
99-
-- throtling poll
99+
-- throttling poll
100100
fiber.sleep(1)
101101
end
102102
end
@@ -110,12 +110,12 @@ function Consumer:_poll_rebalances()
110110
count, err = self._consumer:poll_rebalances(1)
111111
if err ~= nil then
112112
log.error("Consumer poll rebalances error: %s", err)
113-
-- throtling poll
113+
-- throttling poll
114114
fiber.sleep(0.1)
115115
elseif count > 0 then
116116
fiber.yield()
117117
else
118-
-- throtling poll
118+
-- throttling poll
119119
fiber.sleep(0.5)
120120
end
121121
end
@@ -210,19 +210,18 @@ function Producer.create(config)
210210
end
211211

212212
function Producer:_msg_delivery_poll()
213-
local count, err
214213
while true do
215214
local count, err
216215
while true do
217216
count, err = self._producer:msg_delivery_poll(100)
218217
if err ~= nil then
219218
log.error(err)
220-
-- throtling poll
219+
-- throttling poll
221220
fiber.sleep(0.01)
222221
elseif count > 0 then
223222
fiber.yield()
224223
else
225-
-- throtling poll
224+
-- throttling poll
226225
fiber.sleep(0.01)
227226
end
228227
end
@@ -237,12 +236,12 @@ function Producer:_poll_logs()
237236
count, err = self._producer:poll_logs(100)
238237
if err ~= nil then
239238
log.error("Producer poll logs error: %s", err)
240-
-- throtling poll
239+
-- throttling poll
241240
fiber.sleep(0.1)
242241
elseif count > 0 then
243242
fiber.yield()
244243
else
245-
-- throtling poll
244+
-- throttling poll
246245
fiber.sleep(1)
247246
end
248247
end
@@ -256,12 +255,12 @@ function Producer:_poll_errors()
256255
count, err = self._producer:poll_errors(100)
257256
if err ~= nil then
258257
log.error("Producer poll errors error: %s", err)
259-
-- throtling poll
258+
-- throttling poll
260259
fiber.sleep(0.1)
261260
elseif count > 0 then
262261
fiber.yield()
263262
else
264-
-- throtling poll
263+
-- throttling poll
265264
fiber.sleep(1)
266265
end
267266
end

0 commit comments

Comments
 (0)