File tree 1 file changed +4
-3
lines changed
zulip/integrations/log2zulip
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -100,15 +100,16 @@ if __name__ == "__main__":
100
100
parser = zulip .add_default_arguments (argparse .ArgumentParser ()) # type: argparse.ArgumentParser3
101
101
parser .add_argument ("--control-path" , default = "/etc/log2zulip.conf" )
102
102
args = parser .parse_args ()
103
- # On posix systems, we set the config directory explicitly for legacy reasons.
104
- if not args .zulip_config_file and os .name == "posix" :
105
- args .zulip_config_file = "/etc/log2zulip.zuliprc"
106
103
107
104
lock_path = os .path .join (temp_dir , "log2zulip.lock" )
108
105
if os .path .exists (lock_path ):
106
+ # This locking code is here to protect against log2zulip,
107
+ # running in a cron job, ending up with multiple copies
108
+ # running at the same time.
109
109
print ("Log2zulip lock held; not doing anything" )
110
110
sys .exit (0 )
111
111
112
+ # TODO: Convert this locking code to use a standard context manager.
112
113
try :
113
114
open (lock_path , "w" ).write ("1" )
114
115
zulip_client = zulip .init_from_options (args )
You can’t perform that action at this time.
0 commit comments