0
  D   ˆl–Ðz¾”ªC]Šq@=q¦®41hß�þ]�åœlH mJÐŸÉƒî¹È_�uÐb&=LyZËcõÇÆ ¸    # Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/

class BackgroundServices
  class Cli < ::Thor
    # rubocop:disable Zammad/DetectTranslatableString

    def self.exit_on_failure?
      # Signal to Thor API that failures should be reflected in the exit code.
      true
    end

    desc 'start', 'Execute background services.'
    def start
      config = BackgroundServices::ServiceConfig.configuration_from_env(ENV)
      if %w[1 true].include? ENV['BACKGROUND_SERVICES_LOG_TO_STDOUT']
        Zammad::Logging.extend_logging_to_stdout
      elsif Rails.env.development?
        puts 'BackgroundServices do not log to STDOUT. You can enable this by setting BACKGROUND_SERVICES_LOG_TO_STDOUT=1.' # rubocop:disable Rails/Output
      end

      BackgroundServices.new(config).run
    end

    def self.help(shell, subcommand = nil)
      super
      shell.say 'Startup behaviour can be customized with these environment variables:'
      shell.say

      list = [
        ['Service', 'Configuration', 'Variable', 'Default value'],
        ['-------', '-------------', '--------', '-------------'],
      ]
      BackgroundServices.available_services.each do |service|
        service_name = service.name.demodulize
        env_prefix   = "ZAMMAD_#{service_name.underscore.upcase}"
        list.push [service_name, 'worker count', "#{env_prefix}_WORKERS", "0 (= run in main process, max. #{service.max_workers})"]
        if service.max_worker_threads > 1
          list.push [nil, 'threads per worker', "#{env_prefix}_WORKER_THREADS", "#{service.default_worker_threads} (max. #{service.max_worker_threads})"]
        end
        list.push [nil, 'disable service', "#{env_prefix}_DISABLE"]
      end
      shell.print_table(list, indent: 2)

      shell.say
      shell.say 'For more information, please see https://docs.zammad.org/en/latest/appendix/configure-env-vars.html.'
    end

    # rubocop:enable Zammad/DetectTranslatableString
  end
end
  8   ˆl–ß=¿J	•4Å2 EpÜJbÑ¿�þFÛn¬Ü®¾ �§CüÿË„hL‰ßÊÉÈÇ ?÷     /*
 * tkInt.h --
 *
 *	Declarations for things used internally by the Tk
 *	procedures but not exported outside the module.
 *
 * Copyright (c) 1990-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 1998 by Scriptics Corporation.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: $Id: tkInt.h,v 1.56.2.1 2003/10/13 03:30:05 hobbs Exp $
 */

#ifndef _TKINT
#define _TKINT

#ifndef _TK
#include "tk.h"
#endif
#ifdef BUILD_tk
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif

/*
 * Opaque type declarations:
 */

typedef struct TkColormap TkColormap;
typedef struct TkGrabEvent TkGrabEvent;
typedef struct TkpCursor_ *TkpCursor;
typedef struct TkRegion_ *TkRegion;
typedef struct TkStressedCmap TkStressedCmap;
typedef struct TkBindInfo_ *TkBindInfo;

/*
 * Procedure types.
 */

typedef int (TkBindEvalProc) _ANSI_ARGS_((ClientData clientData,
	Tcl_Interp *interp, XEvent *eventPtr, Tk_Window tkwin,
	KeySym keySym));
typedef void (TkBindFreeProc) _ANSI_ARGS_((ClientData clientData));

/*
 * One of the following structures is maintained for each cursor in
 * use in the system.  This structure is used by tkCursor.c and the
 * various system specific cursor files.
 */

typedef struct TkCursor {
    Tk_Cursor cursor;		/* System specific identifier for cursor. */
    Display *display;		/* Display containing cursor. Needed for
				 * disposal and retrieval of cursors. */
    int resourceRefCount;	/* Number of active uses of this cursor (each
				 * active use corresponds to a call to
				 * Tk_AllocPreserveFromObj or Tk_Preserve).
				 * If this count is 0, then this structure
				 * is no longer valid and it isn't present
				 * in a hash table: it is being kept around
				 * only because there are objects referring
				 * to it.  The structure is freed when
				